mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +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:
parent
9776be3131
commit
9de8d17d84
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue