1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

bump gocui to get contexts on keybindings

This commit is contained in:
Jesse Duffield
2019-11-16 12:40:53 +11:00
parent e6be849eb2
commit 44bbc106a9
6 changed files with 25 additions and 9 deletions

View File

@ -295,14 +295,14 @@ func (g *Gui) CurrentView() *View {
// SetKeybinding creates a new keybinding. If viewname equals to ""
// (empty string) then the keybinding will apply to all views. key must
// be a rune or a Key.
func (g *Gui) SetKeybinding(viewname string, key interface{}, mod Modifier, handler func(*Gui, *View) error) error {
func (g *Gui) SetKeybinding(viewname string, contexts []string, key interface{}, mod Modifier, handler func(*Gui, *View) error) error {
var kb *keybinding
k, ch, err := getKey(key)
if err != nil {
return err
}
kb = newKeybinding(viewname, k, ch, mod, handler)
kb = newKeybinding(viewname, contexts, k, ch, mod, handler)
g.keybindings = append(g.keybindings, kb)
return nil
}