summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-26 11:57:06 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-26 19:33:22 +1000
commit92183de29edab53ccdfb99ddcfaa6fc2c359d925 (patch)
tree1f0bad515269b16d76c1687a754bdb8173a5c312 /pkg/gui
parent8dae54ab8ca41c6334c8c664d62b43d487b2914a (diff)
more lenient handling of views not existing
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/context.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go
index a7b887199..29f8be47e 100644
--- a/pkg/gui/context.go
+++ b/pkg/gui/context.go
@@ -477,11 +477,13 @@ func (gui *Gui) activateContext(c Context) error {
gui.setViewTabForContext(c)
if _, err := gui.g.SetCurrentView(viewName); err != nil {
- return err
+ // if view no longer exists, pop again
+ return gui.returnFromContext()
}
if _, err := gui.g.SetViewOnTop(viewName); err != nil {
- return err
+ // if view no longer exists, pop again
+ return gui.returnFromContext()
}
// if the new context's view was previously displaying another context, render the new context