Improve insert item documentation (#115)

This commit is contained in:
mirko 2022-02-03 02:58:08 +01:00 committed by GitHub
parent 18d25458da
commit 005233b529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -324,7 +324,8 @@ func (m *Model) SetItem(index int, item Item) tea.Cmd {
return cmd
}
// Insert an item at the given index. This returns a command.
// Insert an item at the given index. If index is out of the upper bound, the
// item will be appended. This returns a command.
func (m *Model) InsertItem(index int, item Item) tea.Cmd {
var cmd tea.Cmd
m.items = insertItemIntoSlice(m.items, item, index)