awesome-gocui / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
344 stars 39 forks source link

[BUG] Text next to a frame is not displayed #131

Open imishinist opened 4 months ago

imishinist commented 4 months ago

Describe the bug

When the ASCII option of gocui.Gui is false, the characters on the right side of the left frame seem to disappear. Perhaps this occurs because the frame is a wide string, but the View is being drawn from next to it.

To Reproduce Steps to reproduce the behavior:

  1. compile code
  2. run
reproduce code

```go package main import ( "errors" "fmt" "log" "github.com/awesome-gocui/gocui" ) func generateSingleParamView(g *gocui.Gui, name string, body string, coords []int) error { v, err := g.SetView(name, coords[0], coords[1], coords[2], coords[3], 0) if err != nil && err != gocui.ErrUnknownView { return err } v.Title = name fmt.Fprint(v, body) return nil } func main() { g, err := gocui.NewGui(gocui.OutputNormal, false) if err != nil { log.Fatal(err) } defer g.Close() // g.ASCII = true g.SelBgColor = gocui.ColorCyan g.BgColor = gocui.ColorCyan g.SelFgColor = gocui.ColorBlue g.FgColor = gocui.ColorBlue g.FrameColor = gocui.ColorRed g.SelFrameColor = gocui.ColorRed g.SetManagerFunc(layout) maxX, maxY := g.Size() generateSingleParamView(g, "param1", "default1", []int{0, 0, maxX, maxY}) if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil { log.Fatal(err) } if err := g.MainLoop(); err != nil && !errors.Is(err, gocui.ErrQuit) { log.Fatal(err) } } func layout(g *gocui.Gui) error { return nil } func quit(g *gocui.Gui, v *gocui.View) error { return gocui.ErrQuit } ```

Expected behavior I'm hoping that the adjacent text will show up without having to set the ASCII option to false!

Screenshots

out

Environment (please complete the following information):

Additional context I am trying to solve the problem of this tool not displaying properly.

https://github.com/knqyf263/pet/discussions/305