MCPcopy
hub / github.com/mathaou/termdbms / SelectedItem

Method SelectedItem

list/list.go:369–378  ·  view source on GitHub ↗

SelectedItems returns the current selected item in the list.

()

Source from the content-addressed store, hash-verified

367
368// SelectedItems returns the current selected item in the list.
369func (m Model) SelectedItem() Item {
370 i := m.Index()
371
372 items := m.VisibleItems()
373 if i < 0 || len(items) == 0 || len(items) <= i {
374 return nil
375 }
376
377 return items[i]
378}
379
380// MatchesForItem returns rune positions matched by the current filter, if any.
381// Use this to style runes matched by the active filter.

Callers 1

HandleClipboardEventsFunction · 0.80

Calls 2

IndexMethod · 0.95
VisibleItemsMethod · 0.95

Tested by

no test coverage detected