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.
This commit is contained in:
Jesse Duffield 2024-01-15 20:08:11 +11:00
parent d4a0ca35c7
commit fc8998e377

View file

@ -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)
}
}
}
}