diff options
Diffstat (limited to 'toolkit/gocui/showMsg.go')
| -rw-r--r-- | toolkit/gocui/showMsg.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/toolkit/gocui/showMsg.go b/toolkit/gocui/showMsg.go index a03a64d..2a0a873 100644 --- a/toolkit/gocui/showMsg.go +++ b/toolkit/gocui/showMsg.go @@ -11,12 +11,15 @@ import ( "github.com/awesome-gocui/gocui" ) +var outputW int = 80 +var outputH int = 24 + func moveMsg(g *gocui.Gui) { mx, my := g.MousePosition() if !movingMsg && (mx != initialMouseX || my != initialMouseY) { movingMsg = true } - g.SetView("msg", mx-xOffset, my-yOffset, mx-xOffset+20, my-yOffset+7, 0) + g.SetView("msg", mx-xOffset, my-yOffset, mx-xOffset+outputW, my-yOffset+outputH, 0) } func showMsg(g *gocui.Gui, v *gocui.View) error { @@ -31,14 +34,16 @@ func showMsg(g *gocui.Gui, v *gocui.View) error { if l, err = v.Line(cy); err != nil { l = "" } + // setOutput(me.rootNode) maxX, maxY := g.Size() - if v, err := g.SetView("msg", maxX/2-10, maxY/2, maxX/2+10, maxY/2+7, 0); err == nil || errors.Is(err, gocui.ErrUnknownView) { + if v, err := g.SetView("msg", maxX/2, maxY/2, maxX/2+outputW, maxY/2+outputH, 0); err == nil || errors.Is(err, gocui.ErrUnknownView) { v.Clear() v.SelBgColor = gocui.ColorCyan v.SelFgColor = gocui.ColorBlack l += "foo\n" + "bar\n" fmt.Fprintln(v, l) } + g.SetViewOnTop("msg") return nil } |
