diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-20 19:42:58 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | a59ac064d2caa9197c57a3c3e99cf377d5ad0b55 (patch) | |
tree | cd9269af9f767a495444c5327a3f666a7fdf913d /pkg/gui/diffing.go | |
parent | 433d54fcec8bd8ec7f978ec30574d2e1273b7817 (diff) |
statically define context keys
Diffstat (limited to 'pkg/gui/diffing.go')
-rw-r--r-- | pkg/gui/diffing.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/gui/diffing.go b/pkg/gui/diffing.go index 303159e6c..bb143b2a7 100644 --- a/pkg/gui/diffing.go +++ b/pkg/gui/diffing.go @@ -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()} |