1
0
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:
Stefan Haller
2025-08-12 17:10:34 +02:00
parent d8ea83704f
commit a8e44dcea6
4 changed files with 81 additions and 4 deletions

View File

@@ -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