mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
statically define context keys
This commit is contained in:
@ -466,126 +466,126 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Handler: gui.handleBranchPress,
|
||||
Description: gui.Tr.SLocalize("checkout"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.createPullRequest"),
|
||||
Handler: gui.handleCreatePullRequestPress,
|
||||
Description: gui.Tr.SLocalize("createPullRequest"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.checkoutBranchByName"),
|
||||
Handler: gui.handleCheckoutByName,
|
||||
Description: gui.Tr.SLocalize("checkoutByName"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.forceCheckoutBranch"),
|
||||
Handler: gui.handleForceCheckout,
|
||||
Description: gui.Tr.SLocalize("forceCheckout"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.new"),
|
||||
Handler: gui.handleNewBranch,
|
||||
Description: gui.Tr.SLocalize("newBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Handler: gui.handleDeleteBranch,
|
||||
Description: gui.Tr.SLocalize("deleteBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.rebaseBranch"),
|
||||
Handler: gui.handleRebaseOntoLocalBranch,
|
||||
Description: gui.Tr.SLocalize("rebaseBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.mergeIntoCurrentBranch"),
|
||||
Handler: gui.handleMerge,
|
||||
Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.viewGitFlowOptions"),
|
||||
Handler: gui.handleCreateGitFlowMenu,
|
||||
Description: gui.Tr.SLocalize("gitFlowOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.FastForward"),
|
||||
Handler: gui.handleFastForward,
|
||||
Description: gui.Tr.SLocalize("FastForward"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Handler: gui.handleCreateResetToBranchMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.renameBranch"),
|
||||
Handler: gui.handleRenameBranch,
|
||||
Description: gui.Tr.SLocalize("renameBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"localBranches"},
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.handleClipboardCopyBranch,
|
||||
Description: gui.Tr.SLocalize("copyBranchNameToClipboard"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Handler: gui.handleCheckoutTag,
|
||||
Description: gui.Tr.SLocalize("checkout"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Handler: gui.handleDeleteTag,
|
||||
Description: gui.Tr.SLocalize("deleteTag"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.pushTag"),
|
||||
Handler: gui.handlePushTag,
|
||||
Description: gui.Tr.SLocalize("pushTag"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.new"),
|
||||
Handler: gui.handleCreateTag,
|
||||
Description: gui.Tr.SLocalize("createTag"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Handler: gui.handleCreateResetToTagMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
@ -604,21 +604,21 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remoteBranches"},
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.return"),
|
||||
Handler: gui.handleRemoteBranchesEscape,
|
||||
Description: gui.Tr.SLocalize("ReturnToRemotesList"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remoteBranches"},
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Handler: gui.handleCreateResetToRemoteBranchMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.fetchRemote"),
|
||||
Handler: gui.handleFetchRemote,
|
||||
Description: gui.Tr.SLocalize("fetchRemote"),
|
||||
@ -637,147 +637,147 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.squashDown"),
|
||||
Handler: gui.handleCommitSquashDown,
|
||||
Description: gui.Tr.SLocalize("squashDown"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.renameCommit"),
|
||||
Handler: gui.handleRenameCommit,
|
||||
Description: gui.Tr.SLocalize("renameCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.renameCommitWithEditor"),
|
||||
Handler: gui.handleRenameCommitEditor,
|
||||
Description: gui.Tr.SLocalize("renameCommitEditor"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Handler: gui.handleCreateCommitResetMenu,
|
||||
Description: gui.Tr.SLocalize("resetToThisCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.markCommitAsFixup"),
|
||||
Handler: gui.handleCommitFixup,
|
||||
Description: gui.Tr.SLocalize("fixupCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.createFixupCommit"),
|
||||
Handler: gui.handleCreateFixupCommit,
|
||||
Description: gui.Tr.SLocalize("createFixupCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.squashAboveCommits"),
|
||||
Handler: gui.handleSquashAllAboveFixupCommits,
|
||||
Description: gui.Tr.SLocalize("squashAboveCommits"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Handler: gui.handleCommitDelete,
|
||||
Description: gui.Tr.SLocalize("deleteCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.moveDownCommit"),
|
||||
Handler: gui.handleCommitMoveDown,
|
||||
Description: gui.Tr.SLocalize("moveDownCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.moveUpCommit"),
|
||||
Handler: gui.handleCommitMoveUp,
|
||||
Description: gui.Tr.SLocalize("moveUpCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Handler: gui.handleCommitEdit,
|
||||
Description: gui.Tr.SLocalize("editCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.amendToCommit"),
|
||||
Handler: gui.handleCommitAmendTo,
|
||||
Description: gui.Tr.SLocalize("amendToCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.pickCommit"),
|
||||
Handler: gui.handleCommitPick,
|
||||
Description: gui.Tr.SLocalize("pickCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.revertCommit"),
|
||||
Handler: gui.handleCommitRevert,
|
||||
Description: gui.Tr.SLocalize("revertCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.cherryPickCopy"),
|
||||
Handler: gui.handleCopyCommit,
|
||||
Description: gui.Tr.SLocalize("cherryPickCopy"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.handleClipboardCopyCommit,
|
||||
Description: gui.Tr.SLocalize("copyCommitShaToClipboard"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.cherryPickCopyRange"),
|
||||
Handler: gui.handleCopyCommitRange,
|
||||
Description: gui.Tr.SLocalize("cherryPickCopyRange"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.pasteCommits"),
|
||||
Handler: gui.HandlePasteCommits,
|
||||
Description: gui.Tr.SLocalize("pasteCommits"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.goInto"),
|
||||
Handler: gui.wrappedHandler(gui.handleSwitchToCommitFilesPanel),
|
||||
Description: gui.Tr.SLocalize("viewCommitFiles"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.checkoutCommit"),
|
||||
Handler: gui.handleCheckoutCommit,
|
||||
Description: gui.Tr.SLocalize("checkoutCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.new"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.wrappedHandler(gui.handleNewBranchOffCommit),
|
||||
@ -785,28 +785,28 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.tagCommit"),
|
||||
Handler: gui.handleTagCommit,
|
||||
Description: gui.Tr.SLocalize("tagCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branchCommits"},
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.resetCherryPick"),
|
||||
Handler: gui.handleResetCherryPick,
|
||||
Description: gui.Tr.SLocalize("resetCherryPick"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"reflogCommits"},
|
||||
Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Handler: gui.handleCheckoutReflogCommit,
|
||||
Description: gui.Tr.SLocalize("checkoutCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"reflogCommits"},
|
||||
Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Handler: gui.handleCreateReflogResetMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
@ -933,14 +933,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "secondary",
|
||||
Contexts: []string{"normal"},
|
||||
Contexts: []string{MAIN_NORMAL_CONTEXT_KEY},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMouseDownSecondary,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"normal"},
|
||||
Contexts: []string{MAIN_NORMAL_CONTEXT_KEY},
|
||||
Key: gocui.MouseWheelDown,
|
||||
Handler: gui.scrollDownMain,
|
||||
Description: gui.Tr.SLocalize("ScrollDown"),
|
||||
@ -948,7 +948,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"normal"},
|
||||
Contexts: []string{MAIN_NORMAL_CONTEXT_KEY},
|
||||
Key: gocui.MouseWheelUp,
|
||||
Handler: gui.scrollUpMain,
|
||||
Description: gui.Tr.SLocalize("ScrollUp"),
|
||||
@ -956,154 +956,154 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"normal"},
|
||||
Contexts: []string{MAIN_NORMAL_CONTEXT_KEY},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMouseDownMain,
|
||||
},
|
||||
{
|
||||
ViewName: "secondary",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleTogglePanelClick,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.return"),
|
||||
Handler: gui.wrappedHandler(gui.handleStagingEscape),
|
||||
Description: gui.Tr.SLocalize("ReturnToFilesPanel"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Handler: gui.handleToggleStagedSelection,
|
||||
Description: gui.Tr.SLocalize("StageSelection"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Handler: gui.handleResetSelection,
|
||||
Description: gui.Tr.SLocalize("ResetSelection"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.togglePanel"),
|
||||
Handler: gui.handleTogglePanel,
|
||||
Description: gui.Tr.SLocalize("TogglePanel"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.return"),
|
||||
Handler: gui.wrappedHandler(gui.handleEscapePatchBuildingPanel),
|
||||
Description: gui.Tr.SLocalize("ExitLineByLineMode"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.openFile"),
|
||||
Handler: gui.wrappedHandler(gui.handleOpenFileAtLine),
|
||||
Description: gui.Tr.SLocalize("openFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.prevItem"),
|
||||
Handler: gui.handleSelectPrevLine,
|
||||
Description: gui.Tr.SLocalize("PrevLine"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.nextItem"),
|
||||
Handler: gui.handleSelectNextLine,
|
||||
Description: gui.Tr.SLocalize("NextLine"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.prevItem-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevLine,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.nextItem-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextLine,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseWheelUp,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevLine,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseWheelDown,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextLine,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.prevBlock"),
|
||||
Handler: gui.handleSelectPrevHunk,
|
||||
Description: gui.Tr.SLocalize("PrevHunk"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.nextBlock"),
|
||||
Handler: gui.handleSelectNextHunk,
|
||||
Description: gui.Tr.SLocalize("NextHunk"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.prevBlock-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.nextBlock-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextHunk,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Handler: gui.handleFileEdit,
|
||||
Description: gui.Tr.SLocalize("editFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.openFile"),
|
||||
Handler: gui.handleFileOpen,
|
||||
Description: gui.Tr.SLocalize("openFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Handler: gui.handleToggleSelectionForPatch,
|
||||
Description: gui.Tr.SLocalize("ToggleSelectionForPatch"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("main.toggleDragSelect"),
|
||||
Handler: gui.handleToggleSelectRange,
|
||||
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
||||
@ -1111,203 +1111,203 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
// Alias 'V' -> 'v'
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("main.toggleDragSelect-alt"),
|
||||
Handler: gui.handleToggleSelectRange,
|
||||
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("main.toggleSelectHunk"),
|
||||
Handler: gui.handleToggleSelectHunk,
|
||||
Description: gui.Tr.SLocalize("ToggleSelectHunk"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMouseDown,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseLeft,
|
||||
Modifier: gocui.ModMotion,
|
||||
Handler: gui.handleMouseDrag,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseWheelUp,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMouseScrollUp,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patchBuilding", "staging"},
|
||||
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseWheelDown,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMouseScrollDown,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.commitChanges"),
|
||||
Handler: gui.wrappedHandler(gui.handleCommitPress),
|
||||
Description: gui.Tr.SLocalize("CommitChanges"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.commitChangesWithoutHook"),
|
||||
Handler: gui.handleWIPCommitPress,
|
||||
Description: gui.Tr.SLocalize("commitChangesWithoutHook"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("files.commitChangesWithEditor"),
|
||||
Handler: gui.wrappedHandler(gui.handleCommitEditorPress),
|
||||
Description: gui.Tr.SLocalize("CommitChangesWithEditor"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.return"),
|
||||
Handler: gui.wrappedHandler(gui.handleEscapeMerge),
|
||||
Description: gui.Tr.SLocalize("ReturnToFilesPanel"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Handler: gui.handlePickHunk,
|
||||
Description: gui.Tr.SLocalize("PickHunk"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("main.pickBothHunks"),
|
||||
Handler: gui.handlePickBothHunks,
|
||||
Description: gui.Tr.SLocalize("PickBothHunks"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.prevBlock"),
|
||||
Handler: gui.handleSelectPrevConflict,
|
||||
Description: gui.Tr.SLocalize("PrevConflict"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.nextBlock"),
|
||||
Handler: gui.handleSelectNextConflict,
|
||||
Description: gui.Tr.SLocalize("NextConflict"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.prevItem"),
|
||||
Handler: gui.handleSelectTop,
|
||||
Description: gui.Tr.SLocalize("SelectTop"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.nextItem"),
|
||||
Handler: gui.handleSelectBottom,
|
||||
Description: gui.Tr.SLocalize("SelectBottom"),
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"mergin"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseWheelUp,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectTop,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"mergin"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gocui.MouseWheelDown,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectBottom,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"mergin"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.prevBlock-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevConflict,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"mergin"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.nextBlock-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextConflict,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"mergin"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.prevItem-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectTop,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"mergin"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.nextItem-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectBottom,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.undo"),
|
||||
Handler: gui.handlePopFileSnapshot,
|
||||
Description: gui.Tr.SLocalize("undo"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.goInto"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.wrappedHandler(gui.handleRemoteEnter),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.new"),
|
||||
Handler: gui.handleAddRemote,
|
||||
Description: gui.Tr.SLocalize("addNewRemote"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Handler: gui.handleRemoveRemote,
|
||||
Description: gui.Tr.SLocalize("removeRemote"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Handler: gui.handleEditRemote,
|
||||
Description: gui.Tr.SLocalize("editRemote"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remoteBranches"},
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Handler: gui.handleCheckoutRemoteBranch,
|
||||
Description: gui.Tr.SLocalize("checkout"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remoteBranches"},
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.new"),
|
||||
Handler: gui.handleNewBranchOffRemote,
|
||||
Description: gui.Tr.SLocalize("newBranch"),
|
||||
@ -1315,28 +1315,28 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remoteBranches"},
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.mergeIntoCurrentBranch"),
|
||||
Handler: gui.handleMergeRemoteBranch,
|
||||
Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remoteBranches"},
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Handler: gui.handleDeleteRemoteBranch,
|
||||
Description: gui.Tr.SLocalize("deleteBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remoteBranches"},
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.rebaseBranch"),
|
||||
Handler: gui.handleRebaseOntoRemoteBranch,
|
||||
Description: gui.Tr.SLocalize("rebaseBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remoteBranches"},
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("branches.setUpstream"),
|
||||
Handler: gui.handleSetBranchUpstream,
|
||||
Description: gui.Tr.SLocalize("setUpstream"),
|
||||
|
Reference in New Issue
Block a user