()
| 13 | } |
| 14 | |
| 15 | func (m *Model) navigateDown() { |
| 16 | if len(m.results) == 0 { |
| 17 | return |
| 18 | } |
| 19 | if m.cursor < len(m.results)-1 { |
| 20 | m.cursor++ |
| 21 | } else { |
| 22 | m.cursor = 0 // Wrap to top |
| 23 | } |
| 24 | m.updateRenderIndex() |
| 25 | } |
| 26 | |
| 27 | func (m *Model) updateRenderIndex() { |
| 28 | if len(m.results) == 0 { |