mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 05:57:38 -04:00
Leave a command with nothing to say out of the options bar
A command that acts on a diff selection has nothing to say over content that isn't a diff, and says so by describing itself as nothing — but a binding that is displayed on screen is displayed whatever its description, so it would show as a key with an empty label. Leave it out instead. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
dfdb89378c
commit
70e87d9f27
@@ -50,7 +50,11 @@ func (self *OptionsMapMgr) renderContextOptionsMap() {
|
||||
})...)
|
||||
|
||||
bindingsToDisplay := lo.Filter(allBindings, func(binding *types.Binding, _ int) bool {
|
||||
return len(binding.Keys) > 0 && binding.DisplayOnScreen && !binding.IsDisabled()
|
||||
// A binding that describes itself as nothing has nothing to do where we are —
|
||||
// that is how a command which only applies to some of a view's contents says so
|
||||
// — and an empty entry in the options bar would say nothing about it.
|
||||
return len(binding.Keys) > 0 && binding.DisplayOnScreen && !binding.IsDisabled() &&
|
||||
binding.GetShortDescription() != ""
|
||||
})
|
||||
|
||||
optionsMap := lo.Map(bindingsToDisplay, func(binding *types.Binding, _ int) bindingInfo {
|
||||
|
||||
Reference in New Issue
Block a user