From c0cd9dd83535522caa3b7908b33d535df96e04b3 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 17 Oct 2021 17:49:32 +1100 Subject: [PATCH] stop opening suggestions tab when no suggestions present --- pkg/gui/confirmation_panel.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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",