summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-01-31 08:07:34 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-01-31 08:27:49 +1100
commit64782a433e6de09ed797266f463b2552ee6ae1c7 (patch)
treebebbbf5af082e1bedaa743ab20851681efcf599c /pkg/gui/context.go
parent44edb49a6e9c24128a14517f60d1a75f70a539f8 (diff)
fix segfault on line by line panel
The state object is sometimes undefined in the onclick method of the line by line panel. Because we set it to nil in a bunch of places, I've decided to just change the main context to 'normal' before setting it to nil anywhere. That way the keybindings for the line by line panel won't get executed and we won't get a segfault.
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r--pkg/gui/context.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go
index 6424a8707..53b884cc7 100644
--- a/pkg/gui/context.go
+++ b/pkg/gui/context.go
@@ -4,9 +4,9 @@ package gui
// which currently just means a context that affects both the main and secondary views
// other views can have their context changed directly but this function helps
// keep the main and secondary views in sync
-func (gui *Gui) changeMainViewsContext(context string) error {
+func (gui *Gui) changeMainViewsContext(context string) {
if gui.State.MainContext == context {
- return nil
+ return
}
switch context {
@@ -16,5 +16,5 @@ func (gui *Gui) changeMainViewsContext(context string) error {
}
gui.State.MainContext = context
- return nil
+ return
}