Skip to content

Commit

Permalink
feat(font): implement cyclic shifting for item rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
ClxUne09 authored and JanDeDobbeleer committed Sep 12, 2024
1 parent 835350d commit 79c3068
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/font/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,26 @@ func (m *main) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}()
m.spinner.Spinner = spinner.Globe
return m, m.spinner.Tick

case "up", "k":
if m.list != nil {
if m.list.Index() == 0 {
m.list.Select(len(m.list.Items()) - 1)
} else {
m.list.Select(m.list.Index() - 1)
}
}
return m, nil

case "down", "j":
if m.list != nil {
if m.list.Index() == len(m.list.Items())-1 {
m.list.Select(0)
} else {
m.list.Select(m.list.Index() + 1)
}
}
return m, nil
}

case zipMsg:
Expand Down

0 comments on commit 79c3068

Please sign in to comment.