Insert an item at the given index. This returns a command.
(index int, item Item)
| 326 | |
| 327 | // Insert an item at the given index. This returns a command. |
| 328 | func (m *Model) InsertItem(index int, item Item) tea.Cmd { |
| 329 | var cmd tea.Cmd |
| 330 | m.items = insertItemIntoSlice(m.items, item, index) |
| 331 | |
| 332 | if m.filterState != Unfiltered { |
| 333 | cmd = filterItems(*m) |
| 334 | } |
| 335 | |
| 336 | m.updatePagination() |
| 337 | return cmd |
| 338 | } |
| 339 | |
| 340 | // RemoveItem removes an item at the given index. If the index is out of bounds |
| 341 | // this will be a no-op. O(n) complexity, which probably won't matter in the |
nothing calls this directly
no test coverage detected