mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-09 13:47:11 +02:00
re-position key names so that the menu will show 'enter' instead of 'ctrl-m', or 'esc' instead of 'ctrl-['
This commit is contained in:
parent
5f21f190b9
commit
029de4ac86
@ -32,6 +32,39 @@ func (b *Binding) GetKey() string {
|
|||||||
case rune:
|
case rune:
|
||||||
key = int(b.Key.(rune))
|
key = int(b.Key.(rune))
|
||||||
case gocui.Key:
|
case gocui.Key:
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyCtrlSpace {
|
||||||
|
return "ctrl+space"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyCtrlBackslash {
|
||||||
|
return "ctrl+\\"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyCtrlLsqBracket {
|
||||||
|
return "ctrl+["
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyCtrlRsqBracket {
|
||||||
|
return "ctrl+]"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyCtrlSlash {
|
||||||
|
return "ctrl+/"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyCtrlUnderscore {
|
||||||
|
return "ctrl+_"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyBackspace {
|
||||||
|
return "backspace"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyTab {
|
||||||
|
return "tab"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyEnter {
|
||||||
|
return "enter"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeyEsc {
|
||||||
|
return "esc"
|
||||||
|
}
|
||||||
|
if b.Key.(gocui.Key) == gocui.KeySpace {
|
||||||
|
return "space"
|
||||||
|
}
|
||||||
if b.Key.(gocui.Key) == gocui.KeyCtrlA {
|
if b.Key.(gocui.Key) == gocui.KeyCtrlA {
|
||||||
return "ctrl+a"
|
return "ctrl+a"
|
||||||
}
|
}
|
||||||
@ -134,39 +167,6 @@ func (b *Binding) GetKey() string {
|
|||||||
if b.Key.(gocui.Key) == gocui.KeyCtrl8 {
|
if b.Key.(gocui.Key) == gocui.KeyCtrl8 {
|
||||||
return "ctrl+8"
|
return "ctrl+8"
|
||||||
}
|
}
|
||||||
if b.Key.(gocui.Key) == gocui.KeyCtrlSpace {
|
|
||||||
return "ctrl+space"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyCtrlBackslash {
|
|
||||||
return "ctrl+\\"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyCtrlLsqBracket {
|
|
||||||
return "ctrl+["
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyCtrlRsqBracket {
|
|
||||||
return "ctrl+]"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyCtrlSlash {
|
|
||||||
return "ctrl+/"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyCtrlUnderscore {
|
|
||||||
return "ctrl+_"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyBackspace {
|
|
||||||
return "backspace"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyTab {
|
|
||||||
return "tab"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyEnter {
|
|
||||||
return "enter"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyEsc {
|
|
||||||
return "esc"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeySpace {
|
|
||||||
return "space"
|
|
||||||
}
|
|
||||||
if b.Key.(gocui.Key) == gocui.KeyF1 {
|
if b.Key.(gocui.Key) == gocui.KeyF1 {
|
||||||
return "f1"
|
return "f1"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user