mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-08 23:56:15 +02:00
statically define context keys
This commit is contained in:
parent
433d54fcec
commit
a59ac064d2
@ -156,7 +156,7 @@ func (gui *Gui) contextTree() ContextTree {
|
|||||||
OnFocus: gui.handleStatusSelect,
|
OnFocus: gui.handleStatusSelect,
|
||||||
Kind: SIDE_CONTEXT,
|
Kind: SIDE_CONTEXT,
|
||||||
ViewName: "status",
|
ViewName: "status",
|
||||||
Key: "status",
|
Key: STATUS_CONTEXT_KEY,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Files: SimpleContextNode{
|
Files: SimpleContextNode{
|
||||||
|
@ -42,27 +42,27 @@ func (gui *Gui) renderDiff() error {
|
|||||||
// flicking through branches it will be using the local branch name.
|
// flicking through branches it will be using the local branch name.
|
||||||
func (gui *Gui) currentDiffTerminals() []string {
|
func (gui *Gui) currentDiffTerminals() []string {
|
||||||
switch gui.currentContextKey() {
|
switch gui.currentContextKey() {
|
||||||
case "files":
|
case FILES_CONTEXT_KEY:
|
||||||
// not supporting files for now
|
// not supporting files for now
|
||||||
case "commitFiles":
|
case COMMIT_FILES_CONTEXT_KEY:
|
||||||
// not supporting commit files for now
|
// not supporting commit files for now
|
||||||
case "branchCommits":
|
case BRANCH_COMMITS_CONTEXT_KEY:
|
||||||
item := gui.getSelectedCommit()
|
item := gui.getSelectedCommit()
|
||||||
if item != nil {
|
if item != nil {
|
||||||
return []string{item.RefName()}
|
return []string{item.RefName()}
|
||||||
}
|
}
|
||||||
case "reflogCommits":
|
case REFLOG_COMMITS_CONTEXT_KEY:
|
||||||
item := gui.getSelectedReflogCommit()
|
item := gui.getSelectedReflogCommit()
|
||||||
if item != nil {
|
if item != nil {
|
||||||
return []string{item.RefName()}
|
return []string{item.RefName()}
|
||||||
}
|
}
|
||||||
case "stash":
|
case STASH_CONTEXT_KEY:
|
||||||
item := gui.getSelectedStashEntry()
|
item := gui.getSelectedStashEntry()
|
||||||
if item != nil {
|
if item != nil {
|
||||||
return []string{item.RefName()}
|
return []string{item.RefName()}
|
||||||
}
|
}
|
||||||
|
|
||||||
case "localBranches":
|
case LOCAL_BRANCHES_CONTEXT_KEY:
|
||||||
branch := gui.getSelectedBranch()
|
branch := gui.getSelectedBranch()
|
||||||
if branch != nil {
|
if branch != nil {
|
||||||
names := []string{branch.RefName()}
|
names := []string{branch.RefName()}
|
||||||
@ -72,17 +72,17 @@ func (gui *Gui) currentDiffTerminals() []string {
|
|||||||
return names
|
return names
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
case "remotes":
|
case REMOTES_CONTEXT_KEY:
|
||||||
item := gui.getSelectedRemote()
|
item := gui.getSelectedRemote()
|
||||||
if item != nil {
|
if item != nil {
|
||||||
return []string{item.RefName()}
|
return []string{item.RefName()}
|
||||||
}
|
}
|
||||||
case "remoteBranches":
|
case REMOTE_BRANCHES_CONTEXT_KEY:
|
||||||
item := gui.getSelectedRemoteBranch()
|
item := gui.getSelectedRemoteBranch()
|
||||||
if item != nil {
|
if item != nil {
|
||||||
return []string{item.RefName()}
|
return []string{item.RefName()}
|
||||||
}
|
}
|
||||||
case "tags":
|
case TAGS_CONTEXT_KEY:
|
||||||
item := gui.getSelectedTag()
|
item := gui.getSelectedTag()
|
||||||
if item != nil {
|
if item != nil {
|
||||||
return []string{item.RefName()}
|
return []string{item.RefName()}
|
||||||
|
@ -466,126 +466,126 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handleBranchPress,
|
Handler: gui.handleBranchPress,
|
||||||
Description: gui.Tr.SLocalize("checkout"),
|
Description: gui.Tr.SLocalize("checkout"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.createPullRequest"),
|
Key: gui.getKey("branches.createPullRequest"),
|
||||||
Handler: gui.handleCreatePullRequestPress,
|
Handler: gui.handleCreatePullRequestPress,
|
||||||
Description: gui.Tr.SLocalize("createPullRequest"),
|
Description: gui.Tr.SLocalize("createPullRequest"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.checkoutBranchByName"),
|
Key: gui.getKey("branches.checkoutBranchByName"),
|
||||||
Handler: gui.handleCheckoutByName,
|
Handler: gui.handleCheckoutByName,
|
||||||
Description: gui.Tr.SLocalize("checkoutByName"),
|
Description: gui.Tr.SLocalize("checkoutByName"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.forceCheckoutBranch"),
|
Key: gui.getKey("branches.forceCheckoutBranch"),
|
||||||
Handler: gui.handleForceCheckout,
|
Handler: gui.handleForceCheckout,
|
||||||
Description: gui.Tr.SLocalize("forceCheckout"),
|
Description: gui.Tr.SLocalize("forceCheckout"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.new"),
|
Key: gui.getKey("universal.new"),
|
||||||
Handler: gui.handleNewBranch,
|
Handler: gui.handleNewBranch,
|
||||||
Description: gui.Tr.SLocalize("newBranch"),
|
Description: gui.Tr.SLocalize("newBranch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.remove"),
|
Key: gui.getKey("universal.remove"),
|
||||||
Handler: gui.handleDeleteBranch,
|
Handler: gui.handleDeleteBranch,
|
||||||
Description: gui.Tr.SLocalize("deleteBranch"),
|
Description: gui.Tr.SLocalize("deleteBranch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.rebaseBranch"),
|
Key: gui.getKey("branches.rebaseBranch"),
|
||||||
Handler: gui.handleRebaseOntoLocalBranch,
|
Handler: gui.handleRebaseOntoLocalBranch,
|
||||||
Description: gui.Tr.SLocalize("rebaseBranch"),
|
Description: gui.Tr.SLocalize("rebaseBranch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.mergeIntoCurrentBranch"),
|
Key: gui.getKey("branches.mergeIntoCurrentBranch"),
|
||||||
Handler: gui.handleMerge,
|
Handler: gui.handleMerge,
|
||||||
Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"),
|
Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.viewGitFlowOptions"),
|
Key: gui.getKey("branches.viewGitFlowOptions"),
|
||||||
Handler: gui.handleCreateGitFlowMenu,
|
Handler: gui.handleCreateGitFlowMenu,
|
||||||
Description: gui.Tr.SLocalize("gitFlowOptions"),
|
Description: gui.Tr.SLocalize("gitFlowOptions"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.FastForward"),
|
Key: gui.getKey("branches.FastForward"),
|
||||||
Handler: gui.handleFastForward,
|
Handler: gui.handleFastForward,
|
||||||
Description: gui.Tr.SLocalize("FastForward"),
|
Description: gui.Tr.SLocalize("FastForward"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.viewResetOptions"),
|
Key: gui.getKey("commits.viewResetOptions"),
|
||||||
Handler: gui.handleCreateResetToBranchMenu,
|
Handler: gui.handleCreateResetToBranchMenu,
|
||||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.renameBranch"),
|
Key: gui.getKey("branches.renameBranch"),
|
||||||
Handler: gui.handleRenameBranch,
|
Handler: gui.handleRenameBranch,
|
||||||
Description: gui.Tr.SLocalize("renameBranch"),
|
Description: gui.Tr.SLocalize("renameBranch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"localBranches"},
|
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.copyToClipboard"),
|
Key: gui.getKey("universal.copyToClipboard"),
|
||||||
Handler: gui.handleClipboardCopyBranch,
|
Handler: gui.handleClipboardCopyBranch,
|
||||||
Description: gui.Tr.SLocalize("copyBranchNameToClipboard"),
|
Description: gui.Tr.SLocalize("copyBranchNameToClipboard"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"tags"},
|
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handleCheckoutTag,
|
Handler: gui.handleCheckoutTag,
|
||||||
Description: gui.Tr.SLocalize("checkout"),
|
Description: gui.Tr.SLocalize("checkout"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"tags"},
|
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.remove"),
|
Key: gui.getKey("universal.remove"),
|
||||||
Handler: gui.handleDeleteTag,
|
Handler: gui.handleDeleteTag,
|
||||||
Description: gui.Tr.SLocalize("deleteTag"),
|
Description: gui.Tr.SLocalize("deleteTag"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"tags"},
|
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.pushTag"),
|
Key: gui.getKey("branches.pushTag"),
|
||||||
Handler: gui.handlePushTag,
|
Handler: gui.handlePushTag,
|
||||||
Description: gui.Tr.SLocalize("pushTag"),
|
Description: gui.Tr.SLocalize("pushTag"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"tags"},
|
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.new"),
|
Key: gui.getKey("universal.new"),
|
||||||
Handler: gui.handleCreateTag,
|
Handler: gui.handleCreateTag,
|
||||||
Description: gui.Tr.SLocalize("createTag"),
|
Description: gui.Tr.SLocalize("createTag"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"tags"},
|
Contexts: []string{TAGS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.viewResetOptions"),
|
Key: gui.getKey("commits.viewResetOptions"),
|
||||||
Handler: gui.handleCreateResetToTagMenu,
|
Handler: gui.handleCreateResetToTagMenu,
|
||||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||||
@ -604,21 +604,21 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remoteBranches"},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.return"),
|
Key: gui.getKey("universal.return"),
|
||||||
Handler: gui.handleRemoteBranchesEscape,
|
Handler: gui.handleRemoteBranchesEscape,
|
||||||
Description: gui.Tr.SLocalize("ReturnToRemotesList"),
|
Description: gui.Tr.SLocalize("ReturnToRemotesList"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remoteBranches"},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.viewResetOptions"),
|
Key: gui.getKey("commits.viewResetOptions"),
|
||||||
Handler: gui.handleCreateResetToRemoteBranchMenu,
|
Handler: gui.handleCreateResetToRemoteBranchMenu,
|
||||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remotes"},
|
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.fetchRemote"),
|
Key: gui.getKey("branches.fetchRemote"),
|
||||||
Handler: gui.handleFetchRemote,
|
Handler: gui.handleFetchRemote,
|
||||||
Description: gui.Tr.SLocalize("fetchRemote"),
|
Description: gui.Tr.SLocalize("fetchRemote"),
|
||||||
@ -637,147 +637,147 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.squashDown"),
|
Key: gui.getKey("commits.squashDown"),
|
||||||
Handler: gui.handleCommitSquashDown,
|
Handler: gui.handleCommitSquashDown,
|
||||||
Description: gui.Tr.SLocalize("squashDown"),
|
Description: gui.Tr.SLocalize("squashDown"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.renameCommit"),
|
Key: gui.getKey("commits.renameCommit"),
|
||||||
Handler: gui.handleRenameCommit,
|
Handler: gui.handleRenameCommit,
|
||||||
Description: gui.Tr.SLocalize("renameCommit"),
|
Description: gui.Tr.SLocalize("renameCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.renameCommitWithEditor"),
|
Key: gui.getKey("commits.renameCommitWithEditor"),
|
||||||
Handler: gui.handleRenameCommitEditor,
|
Handler: gui.handleRenameCommitEditor,
|
||||||
Description: gui.Tr.SLocalize("renameCommitEditor"),
|
Description: gui.Tr.SLocalize("renameCommitEditor"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.viewResetOptions"),
|
Key: gui.getKey("commits.viewResetOptions"),
|
||||||
Handler: gui.handleCreateCommitResetMenu,
|
Handler: gui.handleCreateCommitResetMenu,
|
||||||
Description: gui.Tr.SLocalize("resetToThisCommit"),
|
Description: gui.Tr.SLocalize("resetToThisCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.markCommitAsFixup"),
|
Key: gui.getKey("commits.markCommitAsFixup"),
|
||||||
Handler: gui.handleCommitFixup,
|
Handler: gui.handleCommitFixup,
|
||||||
Description: gui.Tr.SLocalize("fixupCommit"),
|
Description: gui.Tr.SLocalize("fixupCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.createFixupCommit"),
|
Key: gui.getKey("commits.createFixupCommit"),
|
||||||
Handler: gui.handleCreateFixupCommit,
|
Handler: gui.handleCreateFixupCommit,
|
||||||
Description: gui.Tr.SLocalize("createFixupCommit"),
|
Description: gui.Tr.SLocalize("createFixupCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.squashAboveCommits"),
|
Key: gui.getKey("commits.squashAboveCommits"),
|
||||||
Handler: gui.handleSquashAllAboveFixupCommits,
|
Handler: gui.handleSquashAllAboveFixupCommits,
|
||||||
Description: gui.Tr.SLocalize("squashAboveCommits"),
|
Description: gui.Tr.SLocalize("squashAboveCommits"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.remove"),
|
Key: gui.getKey("universal.remove"),
|
||||||
Handler: gui.handleCommitDelete,
|
Handler: gui.handleCommitDelete,
|
||||||
Description: gui.Tr.SLocalize("deleteCommit"),
|
Description: gui.Tr.SLocalize("deleteCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.moveDownCommit"),
|
Key: gui.getKey("commits.moveDownCommit"),
|
||||||
Handler: gui.handleCommitMoveDown,
|
Handler: gui.handleCommitMoveDown,
|
||||||
Description: gui.Tr.SLocalize("moveDownCommit"),
|
Description: gui.Tr.SLocalize("moveDownCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.moveUpCommit"),
|
Key: gui.getKey("commits.moveUpCommit"),
|
||||||
Handler: gui.handleCommitMoveUp,
|
Handler: gui.handleCommitMoveUp,
|
||||||
Description: gui.Tr.SLocalize("moveUpCommit"),
|
Description: gui.Tr.SLocalize("moveUpCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.edit"),
|
Key: gui.getKey("universal.edit"),
|
||||||
Handler: gui.handleCommitEdit,
|
Handler: gui.handleCommitEdit,
|
||||||
Description: gui.Tr.SLocalize("editCommit"),
|
Description: gui.Tr.SLocalize("editCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.amendToCommit"),
|
Key: gui.getKey("commits.amendToCommit"),
|
||||||
Handler: gui.handleCommitAmendTo,
|
Handler: gui.handleCommitAmendTo,
|
||||||
Description: gui.Tr.SLocalize("amendToCommit"),
|
Description: gui.Tr.SLocalize("amendToCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.pickCommit"),
|
Key: gui.getKey("commits.pickCommit"),
|
||||||
Handler: gui.handleCommitPick,
|
Handler: gui.handleCommitPick,
|
||||||
Description: gui.Tr.SLocalize("pickCommit"),
|
Description: gui.Tr.SLocalize("pickCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.revertCommit"),
|
Key: gui.getKey("commits.revertCommit"),
|
||||||
Handler: gui.handleCommitRevert,
|
Handler: gui.handleCommitRevert,
|
||||||
Description: gui.Tr.SLocalize("revertCommit"),
|
Description: gui.Tr.SLocalize("revertCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.cherryPickCopy"),
|
Key: gui.getKey("commits.cherryPickCopy"),
|
||||||
Handler: gui.handleCopyCommit,
|
Handler: gui.handleCopyCommit,
|
||||||
Description: gui.Tr.SLocalize("cherryPickCopy"),
|
Description: gui.Tr.SLocalize("cherryPickCopy"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.copyToClipboard"),
|
Key: gui.getKey("universal.copyToClipboard"),
|
||||||
Handler: gui.handleClipboardCopyCommit,
|
Handler: gui.handleClipboardCopyCommit,
|
||||||
Description: gui.Tr.SLocalize("copyCommitShaToClipboard"),
|
Description: gui.Tr.SLocalize("copyCommitShaToClipboard"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.cherryPickCopyRange"),
|
Key: gui.getKey("commits.cherryPickCopyRange"),
|
||||||
Handler: gui.handleCopyCommitRange,
|
Handler: gui.handleCopyCommitRange,
|
||||||
Description: gui.Tr.SLocalize("cherryPickCopyRange"),
|
Description: gui.Tr.SLocalize("cherryPickCopyRange"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.pasteCommits"),
|
Key: gui.getKey("commits.pasteCommits"),
|
||||||
Handler: gui.HandlePasteCommits,
|
Handler: gui.HandlePasteCommits,
|
||||||
Description: gui.Tr.SLocalize("pasteCommits"),
|
Description: gui.Tr.SLocalize("pasteCommits"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.goInto"),
|
Key: gui.getKey("universal.goInto"),
|
||||||
Handler: gui.wrappedHandler(gui.handleSwitchToCommitFilesPanel),
|
Handler: gui.wrappedHandler(gui.handleSwitchToCommitFilesPanel),
|
||||||
Description: gui.Tr.SLocalize("viewCommitFiles"),
|
Description: gui.Tr.SLocalize("viewCommitFiles"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.checkoutCommit"),
|
Key: gui.getKey("commits.checkoutCommit"),
|
||||||
Handler: gui.handleCheckoutCommit,
|
Handler: gui.handleCheckoutCommit,
|
||||||
Description: gui.Tr.SLocalize("checkoutCommit"),
|
Description: gui.Tr.SLocalize("checkoutCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.new"),
|
Key: gui.getKey("universal.new"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.wrappedHandler(gui.handleNewBranchOffCommit),
|
Handler: gui.wrappedHandler(gui.handleNewBranchOffCommit),
|
||||||
@ -785,28 +785,28 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.tagCommit"),
|
Key: gui.getKey("commits.tagCommit"),
|
||||||
Handler: gui.handleTagCommit,
|
Handler: gui.handleTagCommit,
|
||||||
Description: gui.Tr.SLocalize("tagCommit"),
|
Description: gui.Tr.SLocalize("tagCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"branchCommits"},
|
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.resetCherryPick"),
|
Key: gui.getKey("commits.resetCherryPick"),
|
||||||
Handler: gui.handleResetCherryPick,
|
Handler: gui.handleResetCherryPick,
|
||||||
Description: gui.Tr.SLocalize("resetCherryPick"),
|
Description: gui.Tr.SLocalize("resetCherryPick"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"reflogCommits"},
|
Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handleCheckoutReflogCommit,
|
Handler: gui.handleCheckoutReflogCommit,
|
||||||
Description: gui.Tr.SLocalize("checkoutCommit"),
|
Description: gui.Tr.SLocalize("checkoutCommit"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
Contexts: []string{"reflogCommits"},
|
Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY},
|
||||||
Key: gui.getKey("commits.viewResetOptions"),
|
Key: gui.getKey("commits.viewResetOptions"),
|
||||||
Handler: gui.handleCreateReflogResetMenu,
|
Handler: gui.handleCreateReflogResetMenu,
|
||||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||||
@ -933,14 +933,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "secondary",
|
ViewName: "secondary",
|
||||||
Contexts: []string{"normal"},
|
Contexts: []string{MAIN_NORMAL_CONTEXT_KEY},
|
||||||
Key: gocui.MouseLeft,
|
Key: gocui.MouseLeft,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleMouseDownSecondary,
|
Handler: gui.handleMouseDownSecondary,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"normal"},
|
Contexts: []string{MAIN_NORMAL_CONTEXT_KEY},
|
||||||
Key: gocui.MouseWheelDown,
|
Key: gocui.MouseWheelDown,
|
||||||
Handler: gui.scrollDownMain,
|
Handler: gui.scrollDownMain,
|
||||||
Description: gui.Tr.SLocalize("ScrollDown"),
|
Description: gui.Tr.SLocalize("ScrollDown"),
|
||||||
@ -948,7 +948,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"normal"},
|
Contexts: []string{MAIN_NORMAL_CONTEXT_KEY},
|
||||||
Key: gocui.MouseWheelUp,
|
Key: gocui.MouseWheelUp,
|
||||||
Handler: gui.scrollUpMain,
|
Handler: gui.scrollUpMain,
|
||||||
Description: gui.Tr.SLocalize("ScrollUp"),
|
Description: gui.Tr.SLocalize("ScrollUp"),
|
||||||
@ -956,154 +956,154 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"normal"},
|
Contexts: []string{MAIN_NORMAL_CONTEXT_KEY},
|
||||||
Key: gocui.MouseLeft,
|
Key: gocui.MouseLeft,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleMouseDownMain,
|
Handler: gui.handleMouseDownMain,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "secondary",
|
ViewName: "secondary",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseLeft,
|
Key: gocui.MouseLeft,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleTogglePanelClick,
|
Handler: gui.handleTogglePanelClick,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.return"),
|
Key: gui.getKey("universal.return"),
|
||||||
Handler: gui.wrappedHandler(gui.handleStagingEscape),
|
Handler: gui.wrappedHandler(gui.handleStagingEscape),
|
||||||
Description: gui.Tr.SLocalize("ReturnToFilesPanel"),
|
Description: gui.Tr.SLocalize("ReturnToFilesPanel"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handleToggleStagedSelection,
|
Handler: gui.handleToggleStagedSelection,
|
||||||
Description: gui.Tr.SLocalize("StageSelection"),
|
Description: gui.Tr.SLocalize("StageSelection"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.remove"),
|
Key: gui.getKey("universal.remove"),
|
||||||
Handler: gui.handleResetSelection,
|
Handler: gui.handleResetSelection,
|
||||||
Description: gui.Tr.SLocalize("ResetSelection"),
|
Description: gui.Tr.SLocalize("ResetSelection"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.togglePanel"),
|
Key: gui.getKey("universal.togglePanel"),
|
||||||
Handler: gui.handleTogglePanel,
|
Handler: gui.handleTogglePanel,
|
||||||
Description: gui.Tr.SLocalize("TogglePanel"),
|
Description: gui.Tr.SLocalize("TogglePanel"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.return"),
|
Key: gui.getKey("universal.return"),
|
||||||
Handler: gui.wrappedHandler(gui.handleEscapePatchBuildingPanel),
|
Handler: gui.wrappedHandler(gui.handleEscapePatchBuildingPanel),
|
||||||
Description: gui.Tr.SLocalize("ExitLineByLineMode"),
|
Description: gui.Tr.SLocalize("ExitLineByLineMode"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.openFile"),
|
Key: gui.getKey("universal.openFile"),
|
||||||
Handler: gui.wrappedHandler(gui.handleOpenFileAtLine),
|
Handler: gui.wrappedHandler(gui.handleOpenFileAtLine),
|
||||||
Description: gui.Tr.SLocalize("openFile"),
|
Description: gui.Tr.SLocalize("openFile"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.prevItem"),
|
Key: gui.getKey("universal.prevItem"),
|
||||||
Handler: gui.handleSelectPrevLine,
|
Handler: gui.handleSelectPrevLine,
|
||||||
Description: gui.Tr.SLocalize("PrevLine"),
|
Description: gui.Tr.SLocalize("PrevLine"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.nextItem"),
|
Key: gui.getKey("universal.nextItem"),
|
||||||
Handler: gui.handleSelectNextLine,
|
Handler: gui.handleSelectNextLine,
|
||||||
Description: gui.Tr.SLocalize("NextLine"),
|
Description: gui.Tr.SLocalize("NextLine"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.prevItem-alt"),
|
Key: gui.getKey("universal.prevItem-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectPrevLine,
|
Handler: gui.handleSelectPrevLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.nextItem-alt"),
|
Key: gui.getKey("universal.nextItem-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectNextLine,
|
Handler: gui.handleSelectNextLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseWheelUp,
|
Key: gocui.MouseWheelUp,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectPrevLine,
|
Handler: gui.handleSelectPrevLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseWheelDown,
|
Key: gocui.MouseWheelDown,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectNextLine,
|
Handler: gui.handleSelectNextLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.prevBlock"),
|
Key: gui.getKey("universal.prevBlock"),
|
||||||
Handler: gui.handleSelectPrevHunk,
|
Handler: gui.handleSelectPrevHunk,
|
||||||
Description: gui.Tr.SLocalize("PrevHunk"),
|
Description: gui.Tr.SLocalize("PrevHunk"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.nextBlock"),
|
Key: gui.getKey("universal.nextBlock"),
|
||||||
Handler: gui.handleSelectNextHunk,
|
Handler: gui.handleSelectNextHunk,
|
||||||
Description: gui.Tr.SLocalize("NextHunk"),
|
Description: gui.Tr.SLocalize("NextHunk"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.prevBlock-alt"),
|
Key: gui.getKey("universal.prevBlock-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectPrevHunk,
|
Handler: gui.handleSelectPrevHunk,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.nextBlock-alt"),
|
Key: gui.getKey("universal.nextBlock-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectNextHunk,
|
Handler: gui.handleSelectNextHunk,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.edit"),
|
Key: gui.getKey("universal.edit"),
|
||||||
Handler: gui.handleFileEdit,
|
Handler: gui.handleFileEdit,
|
||||||
Description: gui.Tr.SLocalize("editFile"),
|
Description: gui.Tr.SLocalize("editFile"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.openFile"),
|
Key: gui.getKey("universal.openFile"),
|
||||||
Handler: gui.handleFileOpen,
|
Handler: gui.handleFileOpen,
|
||||||
Description: gui.Tr.SLocalize("openFile"),
|
Description: gui.Tr.SLocalize("openFile"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handleToggleSelectionForPatch,
|
Handler: gui.handleToggleSelectionForPatch,
|
||||||
Description: gui.Tr.SLocalize("ToggleSelectionForPatch"),
|
Description: gui.Tr.SLocalize("ToggleSelectionForPatch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("main.toggleDragSelect"),
|
Key: gui.getKey("main.toggleDragSelect"),
|
||||||
Handler: gui.handleToggleSelectRange,
|
Handler: gui.handleToggleSelectRange,
|
||||||
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
||||||
@ -1111,203 +1111,203 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
// Alias 'V' -> 'v'
|
// Alias 'V' -> 'v'
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("main.toggleDragSelect-alt"),
|
Key: gui.getKey("main.toggleDragSelect-alt"),
|
||||||
Handler: gui.handleToggleSelectRange,
|
Handler: gui.handleToggleSelectRange,
|
||||||
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("main.toggleSelectHunk"),
|
Key: gui.getKey("main.toggleSelectHunk"),
|
||||||
Handler: gui.handleToggleSelectHunk,
|
Handler: gui.handleToggleSelectHunk,
|
||||||
Description: gui.Tr.SLocalize("ToggleSelectHunk"),
|
Description: gui.Tr.SLocalize("ToggleSelectHunk"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseLeft,
|
Key: gocui.MouseLeft,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleMouseDown,
|
Handler: gui.handleMouseDown,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseLeft,
|
Key: gocui.MouseLeft,
|
||||||
Modifier: gocui.ModMotion,
|
Modifier: gocui.ModMotion,
|
||||||
Handler: gui.handleMouseDrag,
|
Handler: gui.handleMouseDrag,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseWheelUp,
|
Key: gocui.MouseWheelUp,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleMouseScrollUp,
|
Handler: gui.handleMouseScrollUp,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patchBuilding", "staging"},
|
Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseWheelDown,
|
Key: gocui.MouseWheelDown,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleMouseScrollDown,
|
Handler: gui.handleMouseScrollDown,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("files.commitChanges"),
|
Key: gui.getKey("files.commitChanges"),
|
||||||
Handler: gui.wrappedHandler(gui.handleCommitPress),
|
Handler: gui.wrappedHandler(gui.handleCommitPress),
|
||||||
Description: gui.Tr.SLocalize("CommitChanges"),
|
Description: gui.Tr.SLocalize("CommitChanges"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("files.commitChangesWithoutHook"),
|
Key: gui.getKey("files.commitChangesWithoutHook"),
|
||||||
Handler: gui.handleWIPCommitPress,
|
Handler: gui.handleWIPCommitPress,
|
||||||
Description: gui.Tr.SLocalize("commitChangesWithoutHook"),
|
Description: gui.Tr.SLocalize("commitChangesWithoutHook"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"staging"},
|
Contexts: []string{MAIN_STAGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("files.commitChangesWithEditor"),
|
Key: gui.getKey("files.commitChangesWithEditor"),
|
||||||
Handler: gui.wrappedHandler(gui.handleCommitEditorPress),
|
Handler: gui.wrappedHandler(gui.handleCommitEditorPress),
|
||||||
Description: gui.Tr.SLocalize("CommitChangesWithEditor"),
|
Description: gui.Tr.SLocalize("CommitChangesWithEditor"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"merging"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.return"),
|
Key: gui.getKey("universal.return"),
|
||||||
Handler: gui.wrappedHandler(gui.handleEscapeMerge),
|
Handler: gui.wrappedHandler(gui.handleEscapeMerge),
|
||||||
Description: gui.Tr.SLocalize("ReturnToFilesPanel"),
|
Description: gui.Tr.SLocalize("ReturnToFilesPanel"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"merging"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handlePickHunk,
|
Handler: gui.handlePickHunk,
|
||||||
Description: gui.Tr.SLocalize("PickHunk"),
|
Description: gui.Tr.SLocalize("PickHunk"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"merging"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("main.pickBothHunks"),
|
Key: gui.getKey("main.pickBothHunks"),
|
||||||
Handler: gui.handlePickBothHunks,
|
Handler: gui.handlePickBothHunks,
|
||||||
Description: gui.Tr.SLocalize("PickBothHunks"),
|
Description: gui.Tr.SLocalize("PickBothHunks"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"merging"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.prevBlock"),
|
Key: gui.getKey("universal.prevBlock"),
|
||||||
Handler: gui.handleSelectPrevConflict,
|
Handler: gui.handleSelectPrevConflict,
|
||||||
Description: gui.Tr.SLocalize("PrevConflict"),
|
Description: gui.Tr.SLocalize("PrevConflict"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"merging"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.nextBlock"),
|
Key: gui.getKey("universal.nextBlock"),
|
||||||
Handler: gui.handleSelectNextConflict,
|
Handler: gui.handleSelectNextConflict,
|
||||||
Description: gui.Tr.SLocalize("NextConflict"),
|
Description: gui.Tr.SLocalize("NextConflict"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"merging"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.prevItem"),
|
Key: gui.getKey("universal.prevItem"),
|
||||||
Handler: gui.handleSelectTop,
|
Handler: gui.handleSelectTop,
|
||||||
Description: gui.Tr.SLocalize("SelectTop"),
|
Description: gui.Tr.SLocalize("SelectTop"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"merging"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.nextItem"),
|
Key: gui.getKey("universal.nextItem"),
|
||||||
Handler: gui.handleSelectBottom,
|
Handler: gui.handleSelectBottom,
|
||||||
Description: gui.Tr.SLocalize("SelectBottom"),
|
Description: gui.Tr.SLocalize("SelectBottom"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"mergin"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseWheelUp,
|
Key: gocui.MouseWheelUp,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectTop,
|
Handler: gui.handleSelectTop,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"mergin"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gocui.MouseWheelDown,
|
Key: gocui.MouseWheelDown,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectBottom,
|
Handler: gui.handleSelectBottom,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"mergin"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.prevBlock-alt"),
|
Key: gui.getKey("universal.prevBlock-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectPrevConflict,
|
Handler: gui.handleSelectPrevConflict,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"mergin"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.nextBlock-alt"),
|
Key: gui.getKey("universal.nextBlock-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectNextConflict,
|
Handler: gui.handleSelectNextConflict,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"mergin"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.prevItem-alt"),
|
Key: gui.getKey("universal.prevItem-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectTop,
|
Handler: gui.handleSelectTop,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"mergin"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.nextItem-alt"),
|
Key: gui.getKey("universal.nextItem-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectBottom,
|
Handler: gui.handleSelectBottom,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"merging"},
|
Contexts: []string{MAIN_MERGING_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.undo"),
|
Key: gui.getKey("universal.undo"),
|
||||||
Handler: gui.handlePopFileSnapshot,
|
Handler: gui.handlePopFileSnapshot,
|
||||||
Description: gui.Tr.SLocalize("undo"),
|
Description: gui.Tr.SLocalize("undo"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remotes"},
|
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.goInto"),
|
Key: gui.getKey("universal.goInto"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.wrappedHandler(gui.handleRemoteEnter),
|
Handler: gui.wrappedHandler(gui.handleRemoteEnter),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remotes"},
|
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.new"),
|
Key: gui.getKey("universal.new"),
|
||||||
Handler: gui.handleAddRemote,
|
Handler: gui.handleAddRemote,
|
||||||
Description: gui.Tr.SLocalize("addNewRemote"),
|
Description: gui.Tr.SLocalize("addNewRemote"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remotes"},
|
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.remove"),
|
Key: gui.getKey("universal.remove"),
|
||||||
Handler: gui.handleRemoveRemote,
|
Handler: gui.handleRemoveRemote,
|
||||||
Description: gui.Tr.SLocalize("removeRemote"),
|
Description: gui.Tr.SLocalize("removeRemote"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remotes"},
|
Contexts: []string{REMOTES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.edit"),
|
Key: gui.getKey("universal.edit"),
|
||||||
Handler: gui.handleEditRemote,
|
Handler: gui.handleEditRemote,
|
||||||
Description: gui.Tr.SLocalize("editRemote"),
|
Description: gui.Tr.SLocalize("editRemote"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remoteBranches"},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handleCheckoutRemoteBranch,
|
Handler: gui.handleCheckoutRemoteBranch,
|
||||||
Description: gui.Tr.SLocalize("checkout"),
|
Description: gui.Tr.SLocalize("checkout"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remoteBranches"},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.new"),
|
Key: gui.getKey("universal.new"),
|
||||||
Handler: gui.handleNewBranchOffRemote,
|
Handler: gui.handleNewBranchOffRemote,
|
||||||
Description: gui.Tr.SLocalize("newBranch"),
|
Description: gui.Tr.SLocalize("newBranch"),
|
||||||
@ -1315,28 +1315,28 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
|
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remoteBranches"},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.mergeIntoCurrentBranch"),
|
Key: gui.getKey("branches.mergeIntoCurrentBranch"),
|
||||||
Handler: gui.handleMergeRemoteBranch,
|
Handler: gui.handleMergeRemoteBranch,
|
||||||
Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"),
|
Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remoteBranches"},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.remove"),
|
Key: gui.getKey("universal.remove"),
|
||||||
Handler: gui.handleDeleteRemoteBranch,
|
Handler: gui.handleDeleteRemoteBranch,
|
||||||
Description: gui.Tr.SLocalize("deleteBranch"),
|
Description: gui.Tr.SLocalize("deleteBranch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remoteBranches"},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.rebaseBranch"),
|
Key: gui.getKey("branches.rebaseBranch"),
|
||||||
Handler: gui.handleRebaseOntoRemoteBranch,
|
Handler: gui.handleRebaseOntoRemoteBranch,
|
||||||
Description: gui.Tr.SLocalize("rebaseBranch"),
|
Description: gui.Tr.SLocalize("rebaseBranch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{"remoteBranches"},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("branches.setUpstream"),
|
Key: gui.getKey("branches.setUpstream"),
|
||||||
Handler: gui.handleSetBranchUpstream,
|
Handler: gui.handleSetBranchUpstream,
|
||||||
Description: gui.Tr.SLocalize("setUpstream"),
|
Description: gui.Tr.SLocalize("setUpstream"),
|
||||||
|
@ -231,7 +231,7 @@ func (gui *Gui) menuListContext() *ListContext {
|
|||||||
func (gui *Gui) filesListContext() *ListContext {
|
func (gui *Gui) filesListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "files",
|
ViewName: "files",
|
||||||
ContextKey: "files",
|
ContextKey: FILES_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.Files) },
|
GetItemsLength: func() int { return len(gui.State.Files) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.Files },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.Files },
|
||||||
OnFocus: gui.focusAndSelectFile,
|
OnFocus: gui.focusAndSelectFile,
|
||||||
@ -248,7 +248,7 @@ func (gui *Gui) filesListContext() *ListContext {
|
|||||||
func (gui *Gui) branchesListContext() *ListContext {
|
func (gui *Gui) branchesListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
ContextKey: "localBranches",
|
ContextKey: LOCAL_BRANCHES_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.Branches) },
|
GetItemsLength: func() int { return len(gui.State.Branches) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.Branches },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.Branches },
|
||||||
OnFocus: gui.handleBranchSelect,
|
OnFocus: gui.handleBranchSelect,
|
||||||
@ -264,7 +264,7 @@ func (gui *Gui) branchesListContext() *ListContext {
|
|||||||
func (gui *Gui) remotesListContext() *ListContext {
|
func (gui *Gui) remotesListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
ContextKey: "remotes",
|
ContextKey: REMOTES_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.Remotes) },
|
GetItemsLength: func() int { return len(gui.State.Remotes) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.Remotes },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.Remotes },
|
||||||
OnFocus: gui.handleRemoteSelect,
|
OnFocus: gui.handleRemoteSelect,
|
||||||
@ -281,7 +281,7 @@ func (gui *Gui) remotesListContext() *ListContext {
|
|||||||
func (gui *Gui) remoteBranchesListContext() *ListContext {
|
func (gui *Gui) remoteBranchesListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
ContextKey: "remoteBranches",
|
ContextKey: REMOTE_BRANCHES_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.RemoteBranches) },
|
GetItemsLength: func() int { return len(gui.State.RemoteBranches) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.RemoteBranches },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.RemoteBranches },
|
||||||
OnFocus: gui.handleRemoteBranchSelect,
|
OnFocus: gui.handleRemoteBranchSelect,
|
||||||
@ -297,7 +297,7 @@ func (gui *Gui) remoteBranchesListContext() *ListContext {
|
|||||||
func (gui *Gui) tagsListContext() *ListContext {
|
func (gui *Gui) tagsListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
ContextKey: "tags",
|
ContextKey: TAGS_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.Tags) },
|
GetItemsLength: func() int { return len(gui.State.Tags) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.Tags },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.Tags },
|
||||||
OnFocus: gui.handleTagSelect,
|
OnFocus: gui.handleTagSelect,
|
||||||
@ -313,7 +313,7 @@ func (gui *Gui) tagsListContext() *ListContext {
|
|||||||
func (gui *Gui) branchCommitsListContext() *ListContext {
|
func (gui *Gui) branchCommitsListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
ContextKey: "branchCommits",
|
ContextKey: BRANCH_COMMITS_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.Commits) },
|
GetItemsLength: func() int { return len(gui.State.Commits) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.Commits },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.Commits },
|
||||||
OnFocus: gui.handleCommitSelect,
|
OnFocus: gui.handleCommitSelect,
|
||||||
@ -330,7 +330,7 @@ func (gui *Gui) branchCommitsListContext() *ListContext {
|
|||||||
func (gui *Gui) reflogCommitsListContext() *ListContext {
|
func (gui *Gui) reflogCommitsListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "commits",
|
ViewName: "commits",
|
||||||
ContextKey: "reflogCommits",
|
ContextKey: REFLOG_COMMITS_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.FilteredReflogCommits) },
|
GetItemsLength: func() int { return len(gui.State.FilteredReflogCommits) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.ReflogCommits },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.ReflogCommits },
|
||||||
OnFocus: gui.handleReflogCommitSelect,
|
OnFocus: gui.handleReflogCommitSelect,
|
||||||
@ -346,7 +346,7 @@ func (gui *Gui) reflogCommitsListContext() *ListContext {
|
|||||||
func (gui *Gui) stashListContext() *ListContext {
|
func (gui *Gui) stashListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "stash",
|
ViewName: "stash",
|
||||||
ContextKey: "stash",
|
ContextKey: STASH_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.StashEntries) },
|
GetItemsLength: func() int { return len(gui.State.StashEntries) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.Stash },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.Stash },
|
||||||
OnFocus: gui.handleStashEntrySelect,
|
OnFocus: gui.handleStashEntrySelect,
|
||||||
@ -362,7 +362,7 @@ func (gui *Gui) stashListContext() *ListContext {
|
|||||||
func (gui *Gui) commitFilesListContext() *ListContext {
|
func (gui *Gui) commitFilesListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "commitFiles",
|
ViewName: "commitFiles",
|
||||||
ContextKey: "commitFiles",
|
ContextKey: COMMIT_FILES_CONTEXT_KEY,
|
||||||
GetItemsLength: func() int { return len(gui.State.CommitFiles) },
|
GetItemsLength: func() int { return len(gui.State.CommitFiles) },
|
||||||
GetPanelState: func() IListPanelState { return gui.State.Panels.CommitFiles },
|
GetPanelState: func() IListPanelState { return gui.State.Panels.CommitFiles },
|
||||||
OnFocus: gui.handleCommitFileSelect,
|
OnFocus: gui.handleCommitFileSelect,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user