Skip to content

Commit

Permalink
quit only if showCommandInput is false
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Jul 31, 2022
1 parent eb7f65e commit b1b2308
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/tui/keymap.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type KeyMap struct {
// DefaultKeyMap returns a set of default keybindings.
var Keys = KeyMap{
Quit: key.NewBinding(
key.WithKeys("ctrl+q"),
key.WithKeys("q", "ctrl+q"),
),
Down: key.NewBinding(
key.WithKeys("down"),
Expand Down
4 changes: 3 additions & 1 deletion internal/tui/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ func (b *Bubble) handleKeys(msg tea.KeyMsg) tea.Cmd {

switch {
case key.Matches(msg, b.keyMap.Quit):
return tea.Quit
if !b.showCommandInput {
return tea.Quit
}

case key.Matches(msg, b.keyMap.Down):
if b.activeBox == constants.PrimaryBoxActive && !b.showCommandInput && !b.showBoxSpinner {
Expand Down

0 comments on commit b1b2308

Please sign in to comment.