Skip to content

Commit

Permalink
Improve insert item documentation (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkoperillo authored and meowgorithm committed Mar 31, 2022
1 parent c6ac716 commit 1cdf59d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion list/list.go
Expand Up @@ -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)
Expand Down

0 comments on commit 1cdf59d

Please sign in to comment.