Merge pull request #60 from mjarkk/fix-main-focus-bug

Fix main panel focus bug
This commit is contained in:
Jesse Duffield 2019-07-02 19:19:26 +10:00 committed by GitHub
commit 72d9c4a821
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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