mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-08 22:36:49 +02: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:
@ -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()
|
||||
|
Reference in New Issue
Block a user