Skip to content

Commit

Permalink
Feat: shift+tab backward cycle #221
Browse files Browse the repository at this point in the history
  • Loading branch information
tutilus committed Jul 5, 2024
1 parent d7d0b2a commit 9ffa43b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { //nolint:ireturn,cyclo

case tea.KeyMsg:
switch msg.String() {
case "tab":

m.groupSelectedIndex++

if m.groupSelectedIndex > m.groupMaxIndex {
m.groupSelectedIndex = 0
case "tab", "shift+tab":
groupSelectedCursor := -1
if msg.String() == "tab" {
groupSelectedCursor = 1
}

m.groupSelectedIndex = (m.groupSelectedIndex + groupSelectedCursor + m.groupMaxIndex + 1) % (m.groupMaxIndex + 1)
m.groupSelectedName = m.ctx.Groups[m.groupSelectedIndex].Name

return m, generateQuoteMsg(m, true)
Expand Down

0 comments on commit 9ffa43b

Please sign in to comment.