1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

statically define context keys

This commit is contained in:
Jesse Duffield
2020-08-20 19:42:58 +10:00
parent 433d54fcec
commit a59ac064d2
4 changed files with 123 additions and 123 deletions

View File

@ -42,27 +42,27 @@ func (gui *Gui) renderDiff() error {
// flicking through branches it will be using the local branch name.
func (gui *Gui) currentDiffTerminals() []string {
switch gui.currentContextKey() {
case "files":
case FILES_CONTEXT_KEY:
// not supporting files for now
case "commitFiles":
case COMMIT_FILES_CONTEXT_KEY:
// not supporting commit files for now
case "branchCommits":
case BRANCH_COMMITS_CONTEXT_KEY:
item := gui.getSelectedCommit()
if item != nil {
return []string{item.RefName()}
}
case "reflogCommits":
case REFLOG_COMMITS_CONTEXT_KEY:
item := gui.getSelectedReflogCommit()
if item != nil {
return []string{item.RefName()}
}
case "stash":
case STASH_CONTEXT_KEY:
item := gui.getSelectedStashEntry()
if item != nil {
return []string{item.RefName()}
}
case "localBranches":
case LOCAL_BRANCHES_CONTEXT_KEY:
branch := gui.getSelectedBranch()
if branch != nil {
names := []string{branch.RefName()}
@ -72,17 +72,17 @@ func (gui *Gui) currentDiffTerminals() []string {
return names
}
return nil
case "remotes":
case REMOTES_CONTEXT_KEY:
item := gui.getSelectedRemote()
if item != nil {
return []string{item.RefName()}
}
case "remoteBranches":
case REMOTE_BRANCHES_CONTEXT_KEY:
item := gui.getSelectedRemoteBranch()
if item != nil {
return []string{item.RefName()}
}
case "tags":
case TAGS_CONTEXT_KEY:
item := gui.getSelectedTag()
if item != nil {
return []string{item.RefName()}