diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-02-16 21:01:17 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-02-16 21:01:17 +1100 |
commit | e011e9bc4238b97a70ac6e4b35a862a028ce55e4 (patch) | |
tree | b4812f422ee3b38844796617299a5cecc7835369 /pkg/gui/keybindings.go | |
parent | ad93b4c863dfaa6a1cb6bb740d0dba87fef14404 (diff) |
more work on rebasing feature
Diffstat (limited to 'pkg/gui/keybindings.go')
-rw-r--r-- | pkg/gui/keybindings.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 2b5672595..df6bd8ee3 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -417,48 +417,6 @@ func (gui *Gui) keybindings(g *gocui.Gui) error { return nil } -func (gui *Gui) setInitialContexts() error { - contextMap := gui.getContextMap() - - initialContexts := map[string]string{ - "main": "merging", - } - - for viewName, context := range initialContexts { - bindings := contextMap[viewName][context] - for _, binding := range bindings { - if err := gui.g.SetKeybinding(binding.ViewName, binding.Key, binding.Modifier, binding.Handler); err != nil { - return err - } - } - } - - gui.State.Contexts = initialContexts - - return nil -} - -func (gui *Gui) changeContext(viewName, context string) error { - // todo: store somewhere permanently - if gui.State.Contexts[viewName] == context { - return nil - } - - contextMap := gui.getContextMap() - - gui.g.DeleteKeybindings(viewName) - - bindings := contextMap[viewName][context] - for _, binding := range bindings { - if err := gui.g.SetKeybinding(viewName, binding.Key, binding.Modifier, binding.Handler); err != nil { - return err - } - } - gui.State.Contexts[viewName] = context - - return nil -} - func (gui *Gui) getContextMap() map[string]map[string][]*Binding { return map[string]map[string][]*Binding{ "main": { |