diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-10 16:33:31 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-10 22:32:13 +1100 |
commit | 131113b0657eea84f842e2c1e24d0ab1150505e5 (patch) | |
tree | f22c3e0db6ff43655a87bd30aac6f5406ecfab78 /pkg/gui/gui.go | |
parent | e85310c0a92a89167530241bdc3fc5f66a48706d (diff) |
simplify how the context system works
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index b69b30965..1a0c88906 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -155,7 +155,7 @@ type guiState struct { Updating bool Panels *panelStates WorkingTreeState string // one of "merging", "rebasing", "normal" - Contexts map[string]string + Context string // important not to set this value directly but to use gui.changeContext("new context") CherryPickedCommits []*commands.Commit SplitMainPanel bool } @@ -281,11 +281,11 @@ func (gui *Gui) onFocusLost(v *gocui.View, newView *gocui.View) error { } case "main": // if we have lost focus to a first-class panel, we need to do some cleanup - if err := gui.changeContext("main", "normal"); err != nil { + if err := gui.changeContext("normal"); err != nil { return err } case "commitFiles": - if gui.State.Contexts["main"] != "patch-building" { + if gui.State.Context != "patch-building" { if _, err := gui.g.SetViewOnBottom(v.Name()); err != nil { return err } |