diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-10-17 17:49:32 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-10-17 20:05:09 +1100 |
commit | c0cd9dd83535522caa3b7908b33d535df96e04b3 (patch) | |
tree | 8e9e1b45ffd2569b4a48b4fd73861a608c8a3da7 | |
parent | 305f21161516734a293a422354db78bde7e68fbd (diff) |
stop opening suggestions tab when no suggestions present
-rw-r--r-- | pkg/gui/confirmation_panel.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index 17838c1f6..d3e1dac18 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -281,7 +281,12 @@ func (gui *Gui) setKeyBindings(opts createPopupPanelOpts) error { { viewName: "confirmation", key: gui.getKey(keybindingConfig.Universal.TogglePanel), - handler: func() error { return gui.replaceContext(gui.State.Contexts.Suggestions) }, + handler: func() error { + if len(gui.State.Suggestions) > 0 { + return gui.replaceContext(gui.State.Contexts.Suggestions) + } + return nil + }, }, { viewName: "suggestions", |