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

Text wrapping is adding new lines into the output #64

Open juliaschell opened 4 years ago

juliaschell commented 4 years ago

I have an editable field in my UI for users to enter a description for what they're doing, and text wrapping is turned on. When I retrieve and print the buffer as a string at the end, there's a new line where the text wrapped in the UI.

Here's my code for the view:

if v, err := g.SetView("Description", 0, titleHeight+1, twothrdwiDth-1, titleHeight+1+descHeight, 0); err != nil {
        v.Highlight = false
        v.Frame = true
        v.Title = " Description "
        v.SelBgColor = gocui.ColorRed
        v.SelFgColor = gocui.ColorBlack
        v.Editable = true       
                v.Wrap = true
    }
Screen Shot 2020-06-24 at 12 58 47 PM Screen Shot 2020-06-24 at 12 59 28 PM
mjarkk commented 4 years ago

This is a known issue aside from other text input issues :(
I've created a a mr this fix these already a while a go https://github.com/awesome-gocui/gocui/pull/48 but i'm not sure when i'll merge this in because it changed some core things.
First i thought to combine these change together with lots of other issues related to termbox but the mr to fix those has some big performance issue that require (i think) a lot of re-writing to fix.

Aside from that i find it currently hard to get back working on this project as i'm now finally recovering from a depression and to keep it this way i need to do things i like to do for at least the upcoming half year.
I like this project and it's intentions but to change 90% of the code to fix most of the current issues seems equal to creating a new TUI library without having to debug A LOT of code.
Beside that tview looks like a fine project and it's even licensed under the MIT license.

But if you want to help fix these issues feel free to do so help is always welcome that was the main intention of this project!

mjarkk commented 3 years ago

Sorry for the comment above :(,
We just released 2 beta releases and in those we changed the way text is rendered so your issue might be solved now.
Are you open for trying the latest beta release v1.0.0-beta-2 and check if the issue is resolved?