Fixed an escape bug

This commit is contained in:
mjarkk 2019-07-02 09:14:22 +02:00
parent ee53d2447c
commit cb926cd20a
No known key found for this signature in database
GPG key ID: 147D0BE9258C6C95
2 changed files with 6 additions and 2 deletions

View file

@ -97,7 +97,11 @@ func (gui *Gui) handleMainClick(g *gocui.Gui, v *gocui.View) error {
currentView := gui.g.CurrentView()
v.ParentView = currentView
if currentView != nil && currentView.Name() == "main" {
currentView = nil
} else {
v.ParentView = currentView
}
return gui.switchFocus(gui.g, currentView, v)
}

View file

@ -126,7 +126,7 @@ func (gui *Gui) switchFocus(g *gocui.Gui, oldView, newView *gocui.View) error {
gui.State.PreviousView = oldView.Name()
}
gui.Log.Info("setting highlight to true for view" + newView.Name())
gui.Log.Info("setting highlight to true for view " + newView.Name())
gui.Log.Info("new focused view is " + newView.Name())
if _, err := g.SetCurrentView(newView.Name()); err != nil {
return err