mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Don't show error toast for disabled keybindings if DisabledReason text is empty
This makes it possible to "silently" disable a keybinding. The effect is the same as putting the check in the handler and returning nil from there, except that doing it this way also hides it from the bottom line if DisplayOnScreen is true.
This commit is contained in:
parent
9776be3131
commit
9de8d17d84
|
|
@ -453,7 +453,9 @@ func (gui *Gui) callKeybindingHandler(binding *types.Binding) error {
|
|||
return errors.New(disabledReason.Text)
|
||||
}
|
||||
|
||||
gui.c.ErrorToast(gui.Tr.DisabledMenuItemPrefix + disabledReason.Text)
|
||||
if len(disabledReason.Text) > 0 {
|
||||
gui.c.ErrorToast(gui.Tr.DisabledMenuItemPrefix + disabledReason.Text)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return binding.Handler()
|
||||
|
|
|
|||
Loading…
Reference in a new issue