Skip to content

Commit

Permalink
resetting of input now possible with shift+arrow-left
Browse files Browse the repository at this point in the history
  • Loading branch information
toadle committed Oct 26, 2022
1 parent 0cae55e commit 0c8d1c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/tui/bubble.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ func (b *Bubble) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case QueryInput:
teaCmds = append(teaCmds, b.focusSearchList)
}
case tea.KeyShiftLeft:
teaCmds = append(teaCmds, b.resetQueryInput)
case tea.KeyRunes, tea.KeyBackspace:
if b.focus != QueryInput {
teaCmds = append(teaCmds, b.focusQueryInput)
Expand Down Expand Up @@ -193,6 +195,7 @@ func (b *Bubble) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case ResetMsg:
b.queryInput.SetValue("")
teaCmds = append(teaCmds, b.focusQueryInput)
teaCmds = append(teaCmds, b.handleQueryChanged()...)
}

var cmd tea.Cmd
Expand Down Expand Up @@ -329,3 +332,7 @@ func (b *Bubble) focusSearchList() tea.Msg {

return FocusChangeMsg{newFocus: SearchList}
}

func (b *Bubble) resetQueryInput() tea.Msg {
return ResetMsg(0)
}

0 comments on commit 0c8d1c1

Please sign in to comment.