MCPcopy Index your code
hub / github.com/codehamr/codehamr / popoverMoveSelection

Method popoverMoveSelection

internal/tui/popover.go:24–30  ·  view source on GitHub ↗

popoverMoveSelection wraps the selection index modulo the filtered list.

(delta int)

Source from the content-addressed store, hash-verified

22
23// popoverMoveSelection wraps the selection index modulo the filtered list.
24func (m Model) popoverMoveSelection(delta int) (tea.Model, tea.Cmd) {
25 if len(m.suggest) == 0 {
26 return m, nil
27 }
28 m.suggestIdx = (m.suggestIdx + delta + len(m.suggest)) % len(m.suggest)
29 return m, nil
30}
31
32// refreshSuggest recomputes the popover from the textarea: command level before
33// the first space, argument level after it.

Callers 2

handleKeyMethod · 0.95
handleTabMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected