We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ansi.StringWidth treats tabs as zero width, but ansi.Harwrap treats tabs a non-zero width of 1.
ansi.StringWidth
ansi.Harwrap
one would get would unexpected results with a construct such as this :
s := "foo\tbar" n := ansi.StringWidth(s) // n == 6 p := ansi.Hardwrap(s, n, true) // p == "foo\tba\nr" // not "foo\tbar" as one might expect
not sure if this is a bug or intended behavior.
one of the tests for Hardwrap is..
{"tab", "foo\tbar", 3, "foo\n\tba\nr", true},
The text was updated successfully, but these errors were encountered:
fix(ansi): tab is a zero-width character
6241059
Tabs should be treated as zero-width characters when wrapping text. Fixes: #237
Thank you, @pachecot, for opening this issue. I've opened #238 to patch this one 🙂
Sorry, something went wrong.
4179bb1
aymanbagabas
Successfully merging a pull request may close this issue.
ansi.StringWidth
treats tabs as zero width, butansi.Harwrap
treats tabs a non-zero width of 1.one would get would unexpected results with a construct such as this :
not sure if this is a bug or intended behavior.
one of the tests for Hardwrap is..
The text was updated successfully, but these errors were encountered: