mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-10-29 15:09:22 +03:00
Show context-specific labels for the global <esc> binding
WHen several modes are active at the same time, it isn't totally obvious which one will be cancelled first, so show this in the status bar.
This commit is contained in:
@@ -119,6 +119,7 @@ func (self *GlobalController) GetKeybindings(opts types.KeybindingsOpts) []*type
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: self.escape,
|
||||
Description: self.c.Tr.Cancel,
|
||||
DescriptionFunc: self.escapeDescription,
|
||||
GetDisabledReason: self.escapeEnabled,
|
||||
DisplayOnScreen: true,
|
||||
},
|
||||
@@ -191,6 +192,10 @@ func (self *GlobalController) escape() error {
|
||||
return (&QuitActions{c: self.c}).Escape()
|
||||
}
|
||||
|
||||
func (self *GlobalController) escapeDescription() string {
|
||||
return (&QuitActions{c: self.c}).EscapeDescription()
|
||||
}
|
||||
|
||||
func (self *GlobalController) escapeEnabled() *types.DisabledReason {
|
||||
if (&QuitActions{c: self.c}).EscapeEnabled() {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user