diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-17 22:05:15 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | 119d5be1a46d523696654d811c9e39f9743de33e (patch) | |
tree | 2076f30cb6ce4eedd90f807795343e7b7a06c785 /pkg/gui/context.go | |
parent | fcdc0174d99664daad5092768baa9bfb529bd64a (diff) |
move into list context file
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r-- | pkg/gui/context.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go index 7faa16782..5ab4bfe1b 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -411,49 +411,3 @@ func (gui *Gui) changeMainViewsContext(context string) { gui.State.MainContext = context } - -func (gui *Gui) getListContextKeyBindings() []*Binding { - bindings := make([]*Binding, 0) - - for _, listContext := range gui.getListContexts() { - bindings = append(bindings, []*Binding{ - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevItem-alt"), Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevItem"), Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gocui.MouseWheelUp, Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextItem-alt"), Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextItem"), Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevPage"), Modifier: gocui.ModNone, Handler: listContext.handlePrevPage, Description: gui.Tr.SLocalize("prevPage")}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextPage"), Modifier: gocui.ModNone, Handler: listContext.handleNextPage, Description: gui.Tr.SLocalize("nextPage")}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.gotoTop"), Modifier: gocui.ModNone, Handler: listContext.handleGotoTop, Description: gui.Tr.SLocalize("gotoTop")}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gocui.MouseWheelDown, Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gocui.MouseLeft, Modifier: gocui.ModNone, Handler: listContext.handleClick}, - }...) - - // the commits panel needs to lazyload things so it has a couple of its own handlers - openSearchHandler := gui.handleOpenSearch - gotoBottomHandler := listContext.handleGotoBottom - if listContext.ViewName == "commits" { - openSearchHandler = gui.handleOpenSearchForCommitsPanel - gotoBottomHandler = gui.handleGotoBottomForCommitsPanel - } - - bindings = append(bindings, []*Binding{ - { - ViewName: listContext.ViewName, - Contexts: []string{listContext.ContextKey}, - Key: gui.getKey("universal.startSearch"), - Handler: openSearchHandler, - Description: gui.Tr.SLocalize("startSearch"), - }, - { - ViewName: listContext.ViewName, - Contexts: []string{listContext.ContextKey}, - Key: gui.getKey("universal.gotoBottom"), - Handler: gotoBottomHandler, - Description: gui.Tr.SLocalize("gotoBottom"), - }, - }...) - } - - return bindings -} |