summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-16 14:16:28 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit6fb83b740b9b3030d6b6e6ed09f895a7c6a4839d (patch)
treea7dbd7c5c21b5b4ad756f54ad014ea330dd90219 /pkg/gui/context.go
parent7f89113245307be8a1642105014e9ce51a47210f (diff)
WIP
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r--pkg/gui/context.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go
index b209156da..85e653438 100644
--- a/pkg/gui/context.go
+++ b/pkg/gui/context.go
@@ -176,6 +176,7 @@ func (gui *Gui) activateContext(c Context) error {
}
newView := gui.g.CurrentView()
+ newView.Context = c.GetKey()
gui.g.Cursor = newView.Editable
@@ -190,6 +191,7 @@ func (gui *Gui) activateContext(c Context) error {
return err
}
+ // TODO: consider removing this and instead depending on the .Context field of views
gui.State.ViewContextMap[c.GetViewName()] = c
return nil
@@ -228,6 +230,7 @@ func (gui *Gui) createContextTree() {
OnFocus: gui.handleStatusSelect,
Kind: SIDE_CONTEXT,
ViewName: "status",
+ Key: "status",
},
},
Files: SimpleContextNode{
@@ -314,7 +317,7 @@ func (gui *Gui) createContextTree() {
OnFocus: func() error { return gui.handleCommitMessageFocused() },
Kind: PERSISTENT_POPUP,
ViewName: "commitMessage",
- Key: "commit-message",
+ Key: "commit-message", // admittedly awkward to have view names in camelCase and contexts in kebab-case
},
},
Search: SimpleContextNode{