setPopover swaps in a new suggestion set. Selection priority: the current row (e.g. active profile), else the first.
(ms []argOption, argLevel bool, cmdName string)
| 77 | // setPopover swaps in a new suggestion set. Selection priority: the current row |
| 78 | // (e.g. active profile), else the first. |
| 79 | func (m *Model) setPopover(ms []argOption, argLevel bool, cmdName string) { |
| 80 | if len(ms) == 0 { |
| 81 | m.closePopover() |
| 82 | return |
| 83 | } |
| 84 | m.suggest = ms |
| 85 | m.suggestArgLevel = argLevel |
| 86 | m.activeCmd = cmdName |
| 87 | m.suggestOpen = true |
| 88 | m.suggestIdx = selectInitialIdx(ms) |
| 89 | } |
| 90 | |
| 91 | // selectInitialIdx picks the starting row: the current row (e.g. active |
| 92 | // profile), else the first. |
no test coverage detected