Skip to content

Commit

Permalink
feat: shifttab to cycle through sections in reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
NiloCK authored Sep 21, 2022
1 parent 56f4278 commit 4519fd9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tui/bubbles/jqplayground/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,29 @@ func (b Bubble) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
b.output.SetBorderColor(styles.GREY)
}
}
case tea.KeyShiftTab.String():
if b.state != state.Save {
switch b.state {
case state.Query:
b.state = state.Output
b.help.SetState(state.Output)
b.queryinput.SetBorderColor(styles.GREY)
b.inputdata.SetBorderColor(styles.GREY)
b.output.SetBorderColor(styles.BLUE)
case state.Input:
b.state = state.Query
b.help.SetState(state.Query)
b.queryinput.SetBorderColor(styles.BLUE)
b.inputdata.SetBorderColor(styles.GREY)
b.output.SetBorderColor(styles.GREY)
case state.Output:
b.state = state.Input
b.help.SetState(state.Input)
b.queryinput.SetBorderColor(styles.GREY)
b.inputdata.SetBorderColor(styles.BLUE)
b.output.SetBorderColor(styles.GREY)
}
}
case tea.KeyEsc.String():
if b.state == state.Save {
b.state = state.Query
Expand Down

0 comments on commit 4519fd9

Please sign in to comment.