currentSuggestion returns the highlighted popover row, or false when the popover is closed or empty.
()
| 14 | // currentSuggestion returns the highlighted popover row, or false when the |
| 15 | // popover is closed or empty. |
| 16 | func (m Model) currentSuggestion() (argOption, bool) { |
| 17 | if !m.suggestOpen || len(m.suggest) == 0 { |
| 18 | return argOption{}, false |
| 19 | } |
| 20 | return m.suggest[m.suggestIdx], true |
| 21 | } |
| 22 | |
| 23 | // popoverMoveSelection wraps the selection index modulo the filtered list. |
| 24 | func (m Model) popoverMoveSelection(delta int) (tea.Model, tea.Cmd) { |