From 005233b529c76b766c154913d18ee8ceeee5088a Mon Sep 17 00:00:00 2001 From: mirko Date: Thu, 3 Feb 2022 02:58:08 +0100 Subject: [PATCH] Improve insert item documentation (#115) --- list/list.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/list/list.go b/list/list.go index e52552d..e18cc71 100644 --- a/list/list.go +++ b/list/list.go @@ -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)