diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-23 18:43:16 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-23 18:43:16 +1000 |
commit | 5628eae502ee3b4d3d72a8e4045713b637f7a764 (patch) | |
tree | 70b2af957b70667b0d80571164df9d6e65f3777c /pkg/gui/view_helpers.go | |
parent | 954dfb12e466d1fe47231adec977a595730f5836 (diff) |
WIP
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r-- | pkg/gui/view_helpers.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 46fc79e40..cfe985867 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -108,7 +108,11 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) returnFocus(g *gocui.Gui, v *gocui.View) error { previousView, err := g.View(gui.State.PreviousView) if err != nil { - panic(err) + // always fall back to files view if there's no 'previous' view stored + previousView, err = g.View("files") + if err != nil { + gui.Log.Error(err) + } } return gui.switchFocus(g, v, previousView) } @@ -216,6 +220,9 @@ func (gui *Gui) renderString(g *gocui.Gui, viewName, s string) error { if err != nil { return nil } + if viewName == "appStatus" { + gui.Log.Info(s) + } v.Clear() fmt.Fprint(v, s) v.Wrap = true |