Skip to content

Conversation

@markusylisiurunen
Copy link

This is a failing test case related to #451. I tried to pinpoint the actual bug but could not find it (at least yet).

@markusylisiurunen
Copy link
Author

Continued to work on this a bit, I think I have found the location where this "double-wrapping" happens. In ansi/blockelement.go at line 36 before the ansi.Wordwrap call the string looks fine. However, the double wrapping happens by this function.

Before:
"Of course. Based on my exploration, this project is a command-line application written in\nGo. It acts as...                                                                       \n"

After:
"Of course. Based on my exploration, this project is a command-line application written\nin\nGo. It acts as...                                                                       \n"

w.addSpace()
w.addWord()
_, _ = w.buf.WriteRune(c)
w.lineLen++
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This single line was the fix, a PR is open here: muesli/reflow#77

Not sure how you feel about vendoring the wordwrap logic but the muesli/reflow repo seemed to not be active and waiting for a PR merged there may not be fun.

@markusylisiurunen
Copy link
Author

Any input on this @caarlos0 @aymanbagabas?

@nwiggin36-byte
Copy link

This is a failing test case related to #451. I tried to pinpoint the actual bug but could not find it (at least yet)$5000

@aymanbagabas
Copy link
Member

Thank you, @markusylisiurunen, for taking a stab at this. However, currently we're focusing on the v2 branch along with the x/ansi and x/cellbuf packages which provide the word wrapping logic in v2. Please check out these package and whether the v2-exp experiencing the same issue described here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants