1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Include commands without keybinding in options menu

This is not a behavior change, we already include these in the menu, but that's
because of a bug that we will fix in the next commit.

I find it useful to see these commands, especially for rarely-used custom
commands that you don't want to waste a keybinding on.
This commit is contained in:
Stefan Haller
2025-07-19 12:09:46 +02:00
parent 2bd6881f60
commit 7fe96e9aee

View File

@ -1,7 +1,6 @@
package controllers package controllers
import ( import (
"github.com/jesseduffield/lazygit/pkg/gui/keybindings"
"github.com/jesseduffield/lazygit/pkg/gui/types" "github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils" "github.com/jesseduffield/lazygit/pkg/utils"
"github.com/samber/lo" "github.com/samber/lo"
@ -61,7 +60,7 @@ func (self *OptionsMenuAction) getBindings(context types.Context) ([]*types.Bind
bindings, _ := self.c.GetInitialKeybindingsWithCustomCommands() bindings, _ := self.c.GetInitialKeybindingsWithCustomCommands()
for _, binding := range bindings { for _, binding := range bindings {
if keybindings.LabelFromKey(binding.Key) != "" && binding.Description != "" { if binding.Description != "" {
if binding.ViewName == "" { if binding.ViewName == "" {
bindingsGlobal = append(bindingsGlobal, binding) bindingsGlobal = append(bindingsGlobal, binding)
} else if binding.ViewName == context.GetViewName() { } else if binding.ViewName == context.GetViewName() {