diff options
Diffstat (limited to 'pkg/gui/keybindings.go')
-rw-r--r-- | pkg/gui/keybindings.go | 220 |
1 files changed, 110 insertions, 110 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 41c61e07f..a2f762da6 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -16,7 +16,7 @@ import ( type Binding struct { ViewName string Contexts []string - Handler func(*gocui.Gui, *gocui.View) error + Handler func() error Key interface{} // FIXME: find out how to get `gocui.Key | rune` Modifier gocui.Modifier Description string @@ -208,7 +208,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "", Key: gui.getKey(config.Universal.Quit), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleQuit), + Handler: gui.handleQuit, }, { ViewName: "", @@ -220,7 +220,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "", Key: gui.getKey(config.Universal.QuitAlt1), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleQuit), + Handler: gui.handleQuit, }, { ViewName: "", @@ -231,14 +231,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "", Key: gui.getKey(config.Universal.ScrollUpMain), - Handler: gui.wrappedHandler(gui.scrollUpMain), + Handler: gui.scrollUpMain, Alternative: "fn+up", Description: gui.Tr.LcScrollUpMainPanel, }, { ViewName: "", Key: gui.getKey(config.Universal.ScrollDownMain), - Handler: gui.wrappedHandler(gui.scrollDownMain), + Handler: gui.scrollDownMain, Alternative: "fn+down", Description: gui.Tr.LcScrollDownMainPanel, }, @@ -246,30 +246,30 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "", Key: gui.getKey(config.Universal.ScrollUpMainAlt1), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.scrollUpMain), + Handler: gui.scrollUpMain, }, { ViewName: "", Key: gui.getKey(config.Universal.ScrollDownMainAlt1), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.scrollDownMain), + Handler: gui.scrollDownMain, }, { ViewName: "", Key: gui.getKey(config.Universal.ScrollUpMainAlt2), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.scrollUpMain), + Handler: gui.scrollUpMain, }, { ViewName: "", Key: gui.getKey(config.Universal.ScrollDownMainAlt2), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.scrollDownMain), + Handler: gui.scrollDownMain, }, { ViewName: "", Key: gui.getKey(config.Universal.CreateRebaseOptionsMenu), - Handler: gui.wrappedHandler(gui.handleCreateRebaseOptionsMenu), + Handler: gui.handleCreateRebaseOptionsMenu, Description: gui.Tr.ViewMergeRebaseOptions, OpensMenu: true, }, @@ -362,20 +362,20 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "status", Key: gui.getKey(config.Status.RecentRepos), - Handler: gui.wrappedHandler(gui.handleCreateRecentReposMenu), + Handler: gui.handleCreateRecentReposMenu, Description: gui.Tr.SwitchRepo, }, { ViewName: "status", Key: gui.getKey(config.Status.AllBranchesLogGraph), - Handler: gui.wrappedHandler(gui.handleShowAllBranchLogs), + Handler: gui.handleShowAllBranchLogs, Description: gui.Tr.LcAllBranchesLogGraph, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChanges), - Handler: gui.wrappedHandler(gui.handleCommitPress), + Handler: gui.handleCommitPress, Description: gui.Tr.CommitChanges, }, { @@ -389,28 +389,28 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.AmendLastCommit), - Handler: gui.wrappedHandler(gui.handleAmendCommitPress), + Handler: gui.handleAmendCommitPress, Description: gui.Tr.AmendLastCommit, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChangesWithEditor), - Handler: gui.wrappedHandler(gui.handleCommitEditorPress), + Handler: gui.handleCommitEditorPress, Description: gui.Tr.CommitChangesWithEditor, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), - Handler: gui.wrappedHandler(gui.handleFilePress), + Handler: gui.handleFilePress, Description: gui.Tr.LcToggleStaged, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), - Handler: gui.wrappedHandler(gui.handleCreateDiscardMenu), + Handler: gui.handleCreateDiscardMenu, Description: gui.Tr.LcViewDiscardOptions, OpensMenu: true, }, @@ -432,7 +432,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.IgnoreFile), - Handler: gui.wrappedHandler(gui.handleIgnoreFile), + Handler: gui.handleIgnoreFile, Description: gui.Tr.LcIgnoreFile, }, { @@ -490,7 +490,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), - Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), + Handler: gui.handleCopySelectedSideContextItemToClipboard, Description: gui.Tr.LcCopyFileNameToClipboard, }, { @@ -511,7 +511,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.ToggleTreeView), - Handler: gui.wrappedHandler(gui.handleToggleFileTreeView), + Handler: gui.handleToggleFileTreeView, Description: gui.Tr.LcToggleTreeView, }, { @@ -553,7 +553,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), - Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), + Handler: gui.handleNewBranchOffCurrentItem, Description: gui.Tr.LcNewBranch, }, { @@ -611,14 +611,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), - Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), + Handler: gui.handleCopySelectedSideContextItemToClipboard, Description: gui.Tr.LcCopyBranchNameToClipboard, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), - Handler: gui.wrappedHandler(gui.handleSwitchToSubCommits), + Handler: gui.handleSwitchToSubCommits, Description: gui.Tr.LcViewCommits, }, { @@ -661,7 +661,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{TAGS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), - Handler: gui.wrappedHandler(gui.handleSwitchToSubCommits), + Handler: gui.handleSwitchToSubCommits, Description: gui.Tr.LcViewCommits, }, { @@ -683,7 +683,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), - Handler: gui.wrappedHandler(gui.handleSwitchToSubCommits), + Handler: gui.handleSwitchToSubCommits, Description: gui.Tr.LcViewCommits, }, { @@ -795,35 +795,35 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopy), - Handler: gui.wrappedHandler(gui.handleCopyCommit), + Handler: gui.handleCopyCommit, Description: gui.Tr.LcCherryPickCopy, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), - Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), + Handler: gui.handleCopySelectedSideContextItemToClipboard, Description: gui.Tr.LcCopyCommitShaToClipboard, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopyRange), - Handler: gui.wrappedHandler(gui.handleCopyCommitRange), + Handler: gui.handleCopyCommitRange, Description: gui.Tr.LcCherryPickCopyRange, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.PasteCommits), - Handler: gui.wrappedHandler(gui.HandlePasteCommits), + Handler: gui.HandlePasteCommits, Description: gui.Tr.LcPasteCommits, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), - Handler: gui.wrappedHandler(gui.handleViewCommitFiles), + Handler: gui.handleViewCommitFiles, Description: gui.Tr.LcViewCommitFiles, }, { @@ -838,7 +838,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), + Handler: gui.handleNewBranchOffCurrentItem, Description: gui.Tr.LcCreateNewBranchFromCommit, }, { @@ -852,21 +852,21 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ResetCherryPick), - Handler: gui.wrappedHandler(gui.exitCherryPickingMode), + Handler: gui.exitCherryPickingMode, Description: gui.Tr.LcResetCherryPick, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CopyCommitMessageToClipboard), - Handler: gui.wrappedHandler(gui.handleCopySelectedCommitMessageToClipboard), + Handler: gui.handleCopySelectedCommitMessageToClipboard, Description: gui.Tr.LcCopyCommitMessageToClipboard, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), - Handler: gui.wrappedHandler(gui.handleViewReflogCommitFiles), + Handler: gui.handleViewReflogCommitFiles, Description: gui.Tr.LcViewCommitFiles, }, { @@ -888,35 +888,35 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopy), - Handler: gui.wrappedHandler(gui.handleCopyCommit), + Handler: gui.handleCopyCommit, Description: gui.Tr.LcCherryPickCopy, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopyRange), - Handler: gui.wrappedHandler(gui.handleCopyCommitRange), + Handler: gui.handleCopyCommitRange, Description: gui.Tr.LcCherryPickCopyRange, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ResetCherryPick), - Handler: gui.wrappedHandler(gui.exitCherryPickingMode), + Handler: gui.exitCherryPickingMode, Description: gui.Tr.LcResetCherryPick, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), - Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), + Handler: gui.handleCopySelectedSideContextItemToClipboard, Description: gui.Tr.LcCopyCommitShaToClipboard, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), - Handler: gui.wrappedHandler(gui.handleViewSubCommitFiles), + Handler: gui.handleViewSubCommitFiles, Description: gui.Tr.LcViewCommitFiles, }, { @@ -930,7 +930,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ViewResetOptions), - Handler: gui.wrappedHandler(gui.handleCreateSubCommitResetMenu), + Handler: gui.handleCreateSubCommitResetMenu, Description: gui.Tr.LcViewResetOptions, OpensMenu: true, }, @@ -938,41 +938,41 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), - Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), + Handler: gui.handleNewBranchOffCurrentItem, Description: gui.Tr.LcNewBranch, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopy), - Handler: gui.wrappedHandler(gui.handleCopyCommit), + Handler: gui.handleCopyCommit, Description: gui.Tr.LcCherryPickCopy, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopyRange), - Handler: gui.wrappedHandler(gui.handleCopyCommitRange), + Handler: gui.handleCopyCommitRange, Description: gui.Tr.LcCherryPickCopyRange, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ResetCherryPick), - Handler: gui.wrappedHandler(gui.exitCherryPickingMode), + Handler: gui.exitCherryPickingMode, Description: gui.Tr.LcResetCherryPick, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), - Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), + Handler: gui.handleCopySelectedSideContextItemToClipboard, Description: gui.Tr.LcCopyCommitShaToClipboard, }, { ViewName: "stash", Key: gui.getKey(config.Universal.GoInto), - Handler: gui.wrappedHandler(gui.handleViewStashFiles), + Handler: gui.handleViewStashFiles, Description: gui.Tr.LcViewStashFiles, }, { @@ -996,7 +996,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "stash", Key: gui.getKey(config.Universal.New), - Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), + Handler: gui.handleNewBranchOffCurrentItem, Description: gui.Tr.LcNewBranch, }, { @@ -1038,7 +1038,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "commitFiles", Key: gui.getKey(config.Universal.CopyToClipboard), - Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), + Handler: gui.handleCopySelectedSideContextItemToClipboard, Description: gui.Tr.LcCopyCommitFileNameToClipboard, }, { @@ -1080,7 +1080,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "commitFiles", Key: gui.getKey(config.Files.ToggleTreeView), - Handler: gui.wrappedHandler(gui.handleToggleCommitFileTreeView), + Handler: gui.handleToggleCommitFileTreeView, Description: gui.Tr.LcToggleTreeView, }, { @@ -1127,7 +1127,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "main", Contexts: []string{MAIN_NORMAL_CONTEXT_KEY}, Key: gocui.MouseWheelDown, - Handler: gui.wrappedHandler(gui.scrollDownMain), + Handler: gui.scrollDownMain, Description: gui.Tr.ScrollDown, Alternative: "fn+up", }, @@ -1135,7 +1135,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "main", Contexts: []string{MAIN_NORMAL_CONTEXT_KEY}, Key: gocui.MouseWheelUp, - Handler: gui.wrappedHandler(gui.scrollUpMain), + Handler: gui.scrollUpMain, Description: gui.Tr.ScrollUp, Alternative: "fn+down", }, @@ -1157,56 +1157,56 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Return), - Handler: gui.wrappedHandler(gui.handleStagingEscape), + Handler: gui.handleStagingEscape, Description: gui.Tr.ReturnToFilesPanel, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), - Handler: gui.wrappedHandler(gui.handleToggleStagedSelection), + Handler: gui.handleToggleStagedSelection, Description: gui.Tr.StageSelection, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), - Handler: gui.wrappedHandler(gui.handleResetSelection), + Handler: gui.handleResetSelection, Description: gui.Tr.ResetSelection, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.TogglePanel), - Handler: gui.wrappedHandler(gui.handleTogglePanel), + Handler: gui.handleTogglePanel, Description: gui.Tr.TogglePanel, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Return), - Handler: gui.wrappedHandler(gui.handleEscapePatchBuildingPanel), + Handler: gui.handleEscapePatchBuildingPanel, Description: gui.Tr.ExitLineByLineMode, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.OpenFile), - Handler: gui.wrappedHandler(gui.handleOpenFileAtLine), + Handler: gui.handleOpenFileAtLine, Description: gui.Tr.LcOpenFile, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevItem), - Handler: gui.wrappedHandler(gui.handleSelectPrevLine), + Handler: gui.handleSelectPrevLine, Description: gui.Tr.PrevLine, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextItem), - Handler: gui.wrappedHandler(gui.handleSelectNextLine), + Handler: gui.handleSelectNextLine, Description: gui.Tr.NextLine, }, { @@ -1214,34 +1214,34 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevItemAlt), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectPrevLine), + Handler: gui.handleSelectPrevLine, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextItemAlt), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectNextLine), + Handler: gui.handleSelectNextLine, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gocui.MouseWheelUp, Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.scrollUpMain), + Handler: gui.scrollUpMain, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gocui.MouseWheelDown, Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.scrollDownMain), + Handler: gui.scrollDownMain, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevBlock), - Handler: gui.wrappedHandler(gui.handleSelectPrevHunk), + Handler: gui.handleSelectPrevHunk, Description: gui.Tr.PrevHunk, }, { @@ -1249,13 +1249,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevBlockAlt), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectPrevHunk), + Handler: gui.handleSelectPrevHunk, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextBlock), - Handler: gui.wrappedHandler(gui.handleSelectNextHunk), + Handler: gui.handleSelectNextHunk, Description: gui.Tr.NextHunk, }, { @@ -1263,7 +1263,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextBlockAlt), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectNextHunk), + Handler: gui.handleSelectNextHunk, }, { ViewName: "main", @@ -1284,7 +1284,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextPage), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleLineByLineNextPage), + Handler: gui.handleLineByLineNextPage, Description: gui.Tr.LcNextPage, Tag: "navigation", }, @@ -1293,7 +1293,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevPage), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleLineByLinePrevPage), + Handler: gui.handleLineByLinePrevPage, Description: gui.Tr.LcPrevPage, Tag: "navigation", }, @@ -1302,7 +1302,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GotoTop), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleLineByLineGotoTop), + Handler: gui.handleLineByLineGotoTop, Description: gui.Tr.LcGotoTop, Tag: "navigation", }, @@ -1311,7 +1311,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GotoBottom), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleLineByLineGotoBottom), + Handler: gui.handleLineByLineGotoBottom, Description: gui.Tr.LcGotoBottom, Tag: "navigation", }, @@ -1319,7 +1319,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.StartSearch), - Handler: gui.handleOpenSearch, + Handler: func() error { return gui.handleOpenSearch("main") }, Description: gui.Tr.LcStartSearch, Tag: "navigation", }, @@ -1327,14 +1327,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), - Handler: gui.wrappedHandler(gui.handleToggleSelectionForPatch), + Handler: gui.handleToggleSelectionForPatch, Description: gui.Tr.ToggleSelectionForPatch, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Main.ToggleDragSelect), - Handler: gui.wrappedHandler(gui.handleToggleSelectRange), + Handler: gui.handleToggleSelectRange, Description: gui.Tr.ToggleDragSelect, }, // Alias 'V' -> 'v' @@ -1342,14 +1342,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Main.ToggleDragSelectAlt), - Handler: gui.wrappedHandler(gui.handleToggleSelectRange), + Handler: gui.handleToggleSelectRange, Description: gui.Tr.ToggleDragSelect, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Main.ToggleSelectHunk), - Handler: gui.wrappedHandler(gui.handleToggleSelectHunk), + Handler: gui.handleToggleSelectHunk, Description: gui.Tr.ToggleSelectHunk, }, { @@ -1371,20 +1371,20 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gocui.MouseWheelUp, Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.scrollUpMain), + Handler: gui.scrollUpMain, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gocui.MouseWheelDown, Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.scrollDownMain), + Handler: gui.scrollDownMain, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChanges), - Handler: gui.wrappedHandler(gui.handleCommitPress), + Handler: gui.handleCommitPress, Description: gui.Tr.CommitChanges, }, { @@ -1398,56 +1398,56 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChangesWithEditor), - Handler: gui.wrappedHandler(gui.handleCommitEditorPress), + Handler: gui.handleCommitEditorPress, Description: gui.Tr.CommitChangesWithEditor, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Return), - Handler: gui.wrappedHandler(gui.handleEscapeMerge), + Handler: gui.handleEscapeMerge, Description: gui.Tr.ReturnToFilesPanel, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), - Handler: gui.wrappedHandler(gui.handlePickHunk), + Handler: gui.handlePickHunk, Description: gui.Tr.PickHunk, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Main.PickBothHunks), - Handler: gui.wrappedHandler(gui.handlePickBothHunks), + Handler: gui.handlePickBothHunks, Description: gui.Tr.PickBothHunks, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevBlock), - Handler: gui.wrappedHandler(gui.handleSelectPrevConflict), + Handler: gui.handleSelectPrevConflict, Description: gui.Tr.PrevConflict, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextBlock), - Handler: gui.wrappedHandler(gui.handleSelectNextConflict), + Handler: gui.handleSelectNextConflict, Description: gui.Tr.NextConflict, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevItem), - Handler: gui.wrappedHandler(gui.handleSelectTop), + Handler: gui.handleSelectTop, Description: gui.Tr.SelectTop, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextItem), - Handler: gui.wrappedHandler(gui.handleSelectBottom), + Handler: gui.handleSelectBottom, Description: gui.Tr.SelectBottom, }, { @@ -1455,48 +1455,48 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gocui.MouseWheelUp, Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectTop), + Handler: gui.handleSelectTop, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gocui.MouseWheelDown, Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectBottom), + Handler: gui.handleSelectBottom, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevBlockAlt), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectPrevConflict), + Handler: gui.handleSelectPrevConflict, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextBlockAlt), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectNextConflict), + Handler: gui.handleSelectNextConflict, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevItemAlt), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectTop), + Handler: gui.handleSelectTop, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextItemAlt), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleSelectBottom), + Handler: gui.handleSelectBottom, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Undo), - Handler: gui.wrappedHandler(gui.handlePopFileSnapshot), + Handler: gui.handlePopFileSnapshot, Description: gui.Tr.LcUndo, }, { @@ -1504,7 +1504,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{REMOTES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.handleRemoteEnter), + Handler: gui.handleRemoteEnter, }, { ViewName: "branches", @@ -1532,14 +1532,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), // gonna use the exact same handler as the 'n' keybinding because everybody wants this to happen when they checkout a remote branch - Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), + Handler: gui.handleNewBranchOffCurrentItem, Description: gui.Tr.LcCheckout, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), - Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), + Handler: gui.handleNewBranchOffCurrentItem, Description: gui.Tr.LcNewBranch, }, { @@ -1616,25 +1616,25 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "menu", Key: gui.getKey(config.Universal.Select), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.onMenuPress), + Handler: gui.onMenuPress, }, { ViewName: "menu", Key: gui.getKey(config.Universal.Confirm), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.onMenuPress), + Handler: gui.onMenuPress, }, { ViewName: "menu", Key: gui.getKey(config.Universal.ConfirmAlt1), Modifier: gocui.ModNone, - Handler: gui.wrappedHandler(gui.onMenuPress), + Handler: gui.onMenuPress, }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), - Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), + Handler: gui.handleCopySelectedSideContextItemToClipboard, Description: gui.Tr.LcCopySubmoduleNameToClipboard, }, { @@ -1663,7 +1663,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), - Handler: gui.wrappedHandler(gui.handleAddSubmodule), + Handler: gui.handleAddSubmodule, Description: gui.Tr.LcAddSubmodule, }, { @@ -1684,7 +1684,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Submodules.BulkMenu), - Handler: gui.wrappedHandler(gui.handleBulkSubmoduleActionsMenu), + Handler: gui.handleBulkSubmoduleActionsMenu, Description: gui.Tr.LcViewBulkSubmoduleOptions, OpensMenu: true, }, @@ -1692,12 +1692,12 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { for _, viewName := range []string{"status", "branches", "files", "commits", "commitFiles", "stash", "menu"} { bindings = append(bindings, []*Binding{ - {ViewName: viewName, Key: gui.getKey(config.Universal.PrevBlock), Modifier: gocui.ModNone, Handler: gui.wrappedHandler(gui.previousSideWindow)}, - {ViewName: viewName, Key: gui.getKey(config.Universal.NextBlock), Modifier: gocui.ModNone, Handler: gui.wrappedHandler(gui.nextSideWindow)}, - {ViewName: viewName, Key: gui.getKey(config.Universal.PrevBlockAlt), Modifier: gocui.ModNone, Handler: gui.wrappedHandler(gui.previousSideWindow)}, - {ViewName: viewName, Key: gui |