mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
support searching in side panels
For now we're just doing side panels, because it will take more work to support this in the various main panel contexts
This commit is contained in:
14
vendor/github.com/jesseduffield/gocui/keybinding.go
generated
vendored
14
vendor/github.com/jesseduffield/gocui/keybinding.go
generated
vendored
@ -29,6 +29,20 @@ func newKeybinding(viewname string, contexts []string, key Key, ch rune, mod Mod
|
||||
return kb
|
||||
}
|
||||
|
||||
func eventMatchesKey(ev *termbox.Event, key interface{}) bool {
|
||||
// assuming ModNone for now
|
||||
if Modifier(ev.Mod) != ModNone {
|
||||
return false
|
||||
}
|
||||
|
||||
k, ch, err := getKey(key)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return k == Key(ev.Key) && ch == ev.Ch
|
||||
}
|
||||
|
||||
// matchKeypress returns if the keybinding matches the keypress.
|
||||
func (kb *keybinding) matchKeypress(key Key, ch rune, mod Modifier) bool {
|
||||
return kb.key == key && kb.ch == ch && kb.mod == mod
|
||||
|
Reference in New Issue
Block a user