mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
move context keys into context package
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/jesseduffield/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/constants"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/context"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
)
|
||||
|
||||
@ -355,7 +356,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{string(FILES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Remove),
|
||||
Handler: gui.handleCreateDiscardMenu,
|
||||
Description: gui.c.Tr.LcViewDiscardOptions,
|
||||
@ -363,7 +364,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{string(FILES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Files.ViewResetOptions),
|
||||
Handler: gui.handleCreateResetMenu,
|
||||
Description: gui.c.Tr.LcViewResetOptions,
|
||||
@ -371,35 +372,35 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{string(FILES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Files.Fetch),
|
||||
Handler: gui.handleGitFetch,
|
||||
Description: gui.c.Tr.LcFetch,
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{string(FILES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.CopyToClipboard),
|
||||
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
||||
Description: gui.c.Tr.LcCopyFileNameToClipboard,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Select),
|
||||
Handler: gui.handleBranchPress,
|
||||
Description: gui.c.Tr.LcCheckout,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.CreatePullRequest),
|
||||
Handler: gui.handleCreatePullRequestPress,
|
||||
Description: gui.c.Tr.LcCreatePullRequest,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.ViewPullRequestOptions),
|
||||
Handler: gui.handleCreatePullRequestMenu,
|
||||
Description: gui.c.Tr.LcCreatePullRequestOptions,
|
||||
@ -407,56 +408,56 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.CopyPullRequestURL),
|
||||
Handler: gui.handleCopyPullRequestURLPress,
|
||||
Description: gui.c.Tr.LcCopyPullRequestURL,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.CheckoutBranchByName),
|
||||
Handler: gui.handleCheckoutByName,
|
||||
Description: gui.c.Tr.LcCheckoutByName,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.ForceCheckoutBranch),
|
||||
Handler: gui.handleForceCheckout,
|
||||
Description: gui.c.Tr.LcForceCheckout,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.New),
|
||||
Handler: gui.handleNewBranchOffCurrentItem,
|
||||
Description: gui.c.Tr.LcNewBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Remove),
|
||||
Handler: gui.handleDeleteBranch,
|
||||
Description: gui.c.Tr.LcDeleteBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.RebaseBranch),
|
||||
Handler: guards.OutsideFilterMode(gui.handleRebaseOntoLocalBranch),
|
||||
Description: gui.c.Tr.LcRebaseBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.MergeIntoCurrentBranch),
|
||||
Handler: guards.OutsideFilterMode(gui.handleMerge),
|
||||
Description: gui.c.Tr.LcMergeIntoCurrentBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.ViewGitFlowOptions),
|
||||
Handler: gui.handleCreateGitFlowMenu,
|
||||
Description: gui.c.Tr.LcGitFlowOptions,
|
||||
@ -464,14 +465,14 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.FastForward),
|
||||
Handler: gui.handleFastForward,
|
||||
Description: gui.c.Tr.FastForward,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.ViewResetOptions),
|
||||
Handler: gui.handleCreateResetToBranchMenu,
|
||||
Description: gui.c.Tr.LcViewResetOptions,
|
||||
@ -479,35 +480,35 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.RenameBranch),
|
||||
Handler: gui.handleRenameBranch,
|
||||
Description: gui.c.Tr.LcRenameBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.CopyToClipboard),
|
||||
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
||||
Description: gui.c.Tr.LcCopyBranchNameToClipboard,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.GoInto),
|
||||
Handler: gui.handleSwitchToSubCommits,
|
||||
Description: gui.c.Tr.LcViewCommits,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Return),
|
||||
Handler: gui.handleRemoteBranchesEscape,
|
||||
Description: gui.c.Tr.ReturnToRemotesList,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.ViewResetOptions),
|
||||
Handler: gui.handleCreateResetToRemoteBranchMenu,
|
||||
Description: gui.c.Tr.LcViewResetOptions,
|
||||
@ -515,42 +516,42 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.GoInto),
|
||||
Handler: gui.handleSwitchToSubCommits,
|
||||
Description: gui.c.Tr.LcViewCommits,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.CherryPickCopy),
|
||||
Handler: gui.handleCopyCommit,
|
||||
Description: gui.c.Tr.LcCherryPickCopy,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.CopyToClipboard),
|
||||
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
||||
Description: gui.c.Tr.LcCopyCommitShaToClipboard,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.CherryPickCopyRange),
|
||||
Handler: gui.handleCopyCommitRange,
|
||||
Description: gui.c.Tr.LcCherryPickCopyRange,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.PasteCommits),
|
||||
Handler: guards.OutsideFilterMode(gui.HandlePasteCommits),
|
||||
Description: gui.c.Tr.LcPasteCommits,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.New),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleNewBranchOffCurrentItem,
|
||||
@ -558,28 +559,28 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.BRANCH_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.ResetCherryPick),
|
||||
Handler: gui.exitCherryPickingMode,
|
||||
Description: gui.c.Tr.LcResetCherryPick,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.GoInto),
|
||||
Handler: gui.handleViewReflogCommitFiles,
|
||||
Description: gui.c.Tr.LcViewCommitFiles,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Select),
|
||||
Handler: gui.CheckoutReflogCommit,
|
||||
Description: gui.c.Tr.LcCheckoutCommit,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.ViewResetOptions),
|
||||
Handler: gui.handleCreateReflogResetMenu,
|
||||
Description: gui.c.Tr.LcViewResetOptions,
|
||||
@ -587,49 +588,49 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.CherryPickCopy),
|
||||
Handler: guards.OutsideFilterMode(gui.handleCopyCommit),
|
||||
Description: gui.c.Tr.LcCherryPickCopy,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.CherryPickCopyRange),
|
||||
Handler: guards.OutsideFilterMode(gui.handleCopyCommitRange),
|
||||
Description: gui.c.Tr.LcCherryPickCopyRange,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.ResetCherryPick),
|
||||
Handler: gui.exitCherryPickingMode,
|
||||
Description: gui.c.Tr.LcResetCherryPick,
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{string(REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.CopyToClipboard),
|
||||
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
||||
Description: gui.c.Tr.LcCopyCommitShaToClipboard,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(SUB_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.GoInto),
|
||||
Handler: gui.handleViewSubCommitFiles,
|
||||
Description: gui.c.Tr.LcViewCommitFiles,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(SUB_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Select),
|
||||
Handler: gui.handleCheckoutSubCommit,
|
||||
Description: gui.c.Tr.LcCheckoutCommit,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(SUB_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.ViewResetOptions),
|
||||
Handler: gui.handleCreateSubCommitResetMenu,
|
||||
Description: gui.c.Tr.LcViewResetOptions,
|
||||
@ -637,35 +638,35 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(SUB_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.New),
|
||||
Handler: gui.handleNewBranchOffCurrentItem,
|
||||
Description: gui.c.Tr.LcNewBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(SUB_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.CherryPickCopy),
|
||||
Handler: gui.handleCopyCommit,
|
||||
Description: gui.c.Tr.LcCherryPickCopy,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(SUB_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.CherryPickCopyRange),
|
||||
Handler: gui.handleCopyCommitRange,
|
||||
Description: gui.c.Tr.LcCherryPickCopyRange,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(SUB_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Commits.ResetCherryPick),
|
||||
Handler: gui.exitCherryPickingMode,
|
||||
Description: gui.c.Tr.LcResetCherryPick,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(SUB_COMMITS_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.CopyToClipboard),
|
||||
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
||||
Description: gui.c.Tr.LcCopyCommitShaToClipboard,
|
||||
@ -826,14 +827,14 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "secondary",
|
||||
Contexts: []string{string(MAIN_NORMAL_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_NORMAL_CONTEXT_KEY)},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMouseDownSecondary,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_NORMAL_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_NORMAL_CONTEXT_KEY)},
|
||||
Key: gocui.MouseWheelDown,
|
||||
Handler: gui.scrollDownMain,
|
||||
Description: gui.c.Tr.ScrollDown,
|
||||
@ -841,7 +842,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_NORMAL_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_NORMAL_CONTEXT_KEY)},
|
||||
Key: gocui.MouseWheelUp,
|
||||
Handler: gui.scrollUpMain,
|
||||
Description: gui.c.Tr.ScrollUp,
|
||||
@ -849,133 +850,133 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_NORMAL_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_NORMAL_CONTEXT_KEY)},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMouseDownMain,
|
||||
},
|
||||
{
|
||||
ViewName: "secondary",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleTogglePanelClick,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Return),
|
||||
Handler: gui.handleStagingEscape,
|
||||
Description: gui.c.Tr.ReturnToFilesPanel,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Select),
|
||||
Handler: gui.handleToggleStagedSelection,
|
||||
Description: gui.c.Tr.StageSelection,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Remove),
|
||||
Handler: gui.handleResetSelection,
|
||||
Description: gui.c.Tr.ResetSelection,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.TogglePanel),
|
||||
Handler: gui.handleTogglePanel,
|
||||
Description: gui.c.Tr.TogglePanel,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Return),
|
||||
Handler: gui.handleEscapePatchBuildingPanel,
|
||||
Description: gui.c.Tr.ExitLineByLineMode,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.OpenFile),
|
||||
Handler: gui.handleOpenFileAtLine,
|
||||
Description: gui.c.Tr.LcOpenFile,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevItem),
|
||||
Handler: gui.handleSelectPrevLine,
|
||||
Description: gui.c.Tr.PrevLine,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextItem),
|
||||
Handler: gui.handleSelectNextLine,
|
||||
Description: gui.c.Tr.NextLine,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevItemAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevLine,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextItemAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextLine,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gocui.MouseWheelUp,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollUpMain,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gocui.MouseWheelDown,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollDownMain,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevBlock),
|
||||
Handler: gui.handleSelectPrevHunk,
|
||||
Description: gui.c.Tr.PrevHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevBlockAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextBlock),
|
||||
Handler: gui.handleSelectNextHunk,
|
||||
Description: gui.c.Tr.NextHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextBlockAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.CopyToClipboard),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.copySelectedToClipboard,
|
||||
@ -983,21 +984,21 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Edit),
|
||||
Handler: gui.handleLineByLineEdit,
|
||||
Description: gui.c.Tr.LcEditFile,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.OpenFile),
|
||||
Handler: gui.Controllers.Files.Open,
|
||||
Description: gui.c.Tr.LcOpenFile,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextPage),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleLineByLineNextPage,
|
||||
@ -1006,7 +1007,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevPage),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleLineByLinePrevPage,
|
||||
@ -1015,7 +1016,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.GotoTop),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleLineByLineGotoTop,
|
||||
@ -1024,7 +1025,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.GotoBottom),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleLineByLineGotoBottom,
|
||||
@ -1033,7 +1034,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.StartSearch),
|
||||
Handler: func() error { return gui.handleOpenSearch("main") },
|
||||
Description: gui.c.Tr.LcStartSearch,
|
||||
@ -1041,14 +1042,14 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Select),
|
||||
Handler: gui.handleToggleSelectionForPatch,
|
||||
Description: gui.c.Tr.ToggleSelectionForPatch,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Main.ToggleDragSelect),
|
||||
Handler: gui.handleToggleSelectRange,
|
||||
Description: gui.c.Tr.ToggleDragSelect,
|
||||
@ -1056,175 +1057,175 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
// Alias 'V' -> 'v'
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Main.ToggleDragSelectAlt),
|
||||
Handler: gui.handleToggleSelectRange,
|
||||
Description: gui.c.Tr.ToggleDragSelect,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Main.ToggleSelectHunk),
|
||||
Handler: gui.handleToggleSelectHunk,
|
||||
Description: gui.c.Tr.ToggleSelectHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleLBLMouseDown,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModMotion,
|
||||
Handler: gui.handleMouseDrag,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gocui.MouseWheelUp,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollUpMain,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gocui.MouseWheelDown,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollDownMain,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY), string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY), string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.ScrollLeft),
|
||||
Handler: gui.scrollLeftMain,
|
||||
Description: gui.c.Tr.LcScrollLeft,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_PATCH_BUILDING_CONTEXT_KEY), string(MAIN_STAGING_CONTEXT_KEY), string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY), string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.ScrollRight),
|
||||
Handler: gui.scrollRightMain,
|
||||
Description: gui.c.Tr.LcScrollRight,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Files.CommitChanges),
|
||||
Handler: gui.Controllers.Files.HandleCommitPress,
|
||||
Description: gui.c.Tr.CommitChanges,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Files.CommitChangesWithoutHook),
|
||||
Handler: gui.Controllers.Files.HandleWIPCommitPress,
|
||||
Description: gui.c.Tr.LcCommitChangesWithoutHook,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_STAGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Files.CommitChangesWithEditor),
|
||||
Handler: gui.Controllers.Files.HandleCommitEditorPress,
|
||||
Description: gui.c.Tr.CommitChangesWithEditor,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Return),
|
||||
Handler: gui.handleEscapeMerge,
|
||||
Description: gui.c.Tr.ReturnToFilesPanel,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Files.OpenMergeTool),
|
||||
Handler: gui.Controllers.Files.OpenMergeTool,
|
||||
Description: gui.c.Tr.LcOpenMergeTool,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Select),
|
||||
Handler: gui.handlePickHunk,
|
||||
Description: gui.c.Tr.PickHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Main.PickBothHunks),
|
||||
Handler: gui.handlePickAllHunks,
|
||||
Description: gui.c.Tr.PickAllHunks,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevBlock),
|
||||
Handler: gui.handleSelectPrevConflict,
|
||||
Description: gui.c.Tr.PrevConflict,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextBlock),
|
||||
Handler: gui.handleSelectNextConflict,
|
||||
Description: gui.c.Tr.NextConflict,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevItem),
|
||||
Handler: gui.handleSelectPrevConflictHunk,
|
||||
Description: gui.c.Tr.SelectPrevHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextItem),
|
||||
Handler: gui.handleSelectNextConflictHunk,
|
||||
Description: gui.c.Tr.SelectNextHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevBlockAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevConflict,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextBlockAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextConflict,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevItemAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevConflictHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextItemAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextConflictHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{string(MAIN_MERGING_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Undo),
|
||||
Handler: gui.handleMergeConflictUndo,
|
||||
Description: gui.c.Tr.LcUndo,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.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.handleNewBranchOffCurrentItem,
|
||||
@ -1232,35 +1233,35 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.New),
|
||||
Handler: gui.handleNewBranchOffCurrentItem,
|
||||
Description: gui.c.Tr.LcNewBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.MergeIntoCurrentBranch),
|
||||
Handler: guards.OutsideFilterMode(gui.handleMergeRemoteBranch),
|
||||
Description: gui.c.Tr.LcMergeIntoCurrentBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.Remove),
|
||||
Handler: gui.handleDeleteRemoteBranch,
|
||||
Description: gui.c.Tr.LcDeleteBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.RebaseBranch),
|
||||
Handler: guards.OutsideFilterMode(gui.handleRebaseOntoRemoteBranch),
|
||||
Description: gui.c.Tr.LcRebaseBranch,
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{string(REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Branches.SetUpstream),
|
||||
Handler: gui.handleSetBranchUpstream,
|
||||
Description: gui.c.Tr.LcSetUpstream,
|
||||
@ -1309,14 +1310,14 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{string(SUBMODULES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.SUBMODULES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.CopyToClipboard),
|
||||
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
||||
Description: gui.c.Tr.LcCopySubmoduleNameToClipboard,
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{string(FILES_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.ToggleWhitespaceInDiffView),
|
||||
Handler: gui.toggleWhitespaceInDiffView,
|
||||
Description: gui.c.Tr.ToggleWhitespaceInDiffView,
|
||||
@ -1353,7 +1354,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
{
|
||||
ViewName: "extras",
|
||||
Tag: "navigation",
|
||||
Contexts: []string{string(COMMAND_LOG_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.COMMAND_LOG_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevItemAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollUpExtra,
|
||||
@ -1361,7 +1362,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
{
|
||||
ViewName: "extras",
|
||||
Tag: "navigation",
|
||||
Contexts: []string{string(COMMAND_LOG_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.COMMAND_LOG_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.PrevItem),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollUpExtra,
|
||||
@ -1369,7 +1370,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
{
|
||||
ViewName: "extras",
|
||||
Tag: "navigation",
|
||||
Contexts: []string{string(COMMAND_LOG_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.COMMAND_LOG_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextItem),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollDownExtra,
|
||||
@ -1377,7 +1378,7 @@ func (gui *Gui) GetInitialKeybindings() []*types.Binding {
|
||||
{
|
||||
ViewName: "extras",
|
||||
Tag: "navigation",
|
||||
Contexts: []string{string(COMMAND_LOG_CONTEXT_KEY)},
|
||||
Contexts: []string{string(context.COMMAND_LOG_CONTEXT_KEY)},
|
||||
Key: gui.getKey(config.Universal.NextItemAlt),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollDownExtra,
|
||||
|
Reference in New Issue
Block a user