From b1b23082ddaf76fc125a9e851a62f135fcf29ddd Mon Sep 17 00:00:00 2001 From: Abdfn <64256993+abdfnx@users.noreply.github.com> Date: Sun, 31 Jul 2022 14:47:56 +0000 Subject: [PATCH] quit only if `showCommandInput` is false --- internal/tui/keymap.go | 2 +- internal/tui/update.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/tui/keymap.go b/internal/tui/keymap.go index 7c7b5ff..5632f48 100644 --- a/internal/tui/keymap.go +++ b/internal/tui/keymap.go @@ -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"), diff --git a/internal/tui/update.go b/internal/tui/update.go index 9e8f20f..26f0271 100644 --- a/internal/tui/update.go +++ b/internal/tui/update.go @@ -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 {