From fc8998e377a59da74e69654c302428527d5a3efb Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 15 Jan 2024 20:08:11 +1100 Subject: [PATCH] Do not include keybindings from another view in keybindings menu Previously we included all navigation keybindings from all views in the keybindings menu, meaning if you pressed enter on 'next page' in the commits view, you'd end up triggering the action in the sub-commits view. --- pkg/gui/controllers/options_menu_action.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/gui/controllers/options_menu_action.go b/pkg/gui/controllers/options_menu_action.go index 1100cf876..d46025afc 100644 --- a/pkg/gui/controllers/options_menu_action.go +++ b/pkg/gui/controllers/options_menu_action.go @@ -69,10 +69,12 @@ func (self *OptionsMenuAction) getBindings(context types.Context) ([]*types.Bind if keybindings.LabelFromKey(binding.Key) != "" && binding.Description != "" { if binding.ViewName == "" { bindingsGlobal = append(bindingsGlobal, binding) - } else if binding.Tag == "navigation" { - bindingsNavigation = append(bindingsNavigation, binding) } else if binding.ViewName == context.GetViewName() { - bindingsPanel = append(bindingsPanel, binding) + if binding.Tag == "navigation" { + bindingsNavigation = append(bindingsNavigation, binding) + } else { + bindingsPanel = append(bindingsPanel, binding) + } } } }