Fix search and keybinding when using Shift

pull/263/head
Vuong 3 years ago
parent 8b8db3bd13
commit 955eb7dcef
No known key found for this signature in database
GPG Key ID: 9E32EEF440B0A5D4

@ -33,7 +33,7 @@ var DefaultEditor Editor = EditorFunc(simpleEditor)
// simpleEditor is used as the default gocui editor.
func simpleEditor(v *View, key tcell.Key, ch rune, mod tcell.ModMask) {
switch {
case key == tcell.KeyRune && ch != 0 && mod == 0:
case key == tcell.KeyRune && ch != 0 && (mod == tcell.ModShift || mod == tcell.ModNone):
v.EditWrite(ch)
case key == ' ':
v.EditWrite(' ')

@ -41,7 +41,7 @@ func (kb *eventBinding) matchEvent(e tcell.Event) bool {
case *tcell.EventKey:
if kbe, ok := kb.ev.(*tcell.EventKey); ok {
if tev.Key() == tcell.KeyRune {
return tev.Key() == kbe.Key() && tev.Rune() == kbe.Rune() && tev.Modifiers() == kbe.Modifiers()
return tev.Key() == kbe.Key() && tev.Rune() == kbe.Rune()
}
return tev.Key() == kbe.Key() && tev.Modifiers() == kbe.Modifiers()
}

Loading…
Cancel
Save