Skip to content

Commit

Permalink
infinite cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
somnek committed Apr 2, 2023
1 parent 2aa2306 commit 27a1882
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "up", "k":
if m.cursor > 0 {
m.cursor--
} else {
m.cursor = len(m.choices) - 1
}
case "down", "j":
if m.cursor < len(m.choices)-1 {
m.cursor++
} else {
m.cursor = 0
}
case "enter", " ":
_, ok := m.selected[m.cursor]
Expand Down

0 comments on commit 27a1882

Please sign in to comment.