diff --git a/eventMouseMove.go b/eventMouseMove.go index 16dee6c..77ce7f8 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -31,6 +31,22 @@ func mouseMove(g *gocui.Gui) { } } + // toggle off all highlight vies except for whatever is under the mouse + for _, view := range g.Views() { + view.Highlight = false + } + if v, err := g.ViewByPosition(w, h); err == nil { + v.Highlight = true + } + + // create the 'msg' view if it does not yet exist // TODO: put this somewhere more correct + if widgetView, _ := g.View("msg"); widgetView == nil { + if createStdout(g) { + return + } + return + } + if me.globalMouseDown && me.dropdown.active { log.Info("can't drag while dropdown is active", w, h) return @@ -86,20 +102,6 @@ func mouseMove(g *gocui.Gui) { log.Info(fmt.Sprintf("findByXY() empty. nothing to move at (%d,%d)", w, h)) } } - - if widgetView, _ := g.View("msg"); widgetView == nil { - if createStdout(g) { - return - } - return - } - - for _, view := range g.Views() { - view.Highlight = false - } - if v, err := g.ViewByPosition(w, h); err == nil { - v.Highlight = true - } } // this is how the window gets dragged around