-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
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
Extra newlines when combining unconditional and standard word wrapping #43
Extra newlines when combining unconditional and standard word wrapping #43
Comments
We could probably enhance wordwrap to include forceful newlines to break words at the given width. The wrapper is behaving as expected in this case. (New lines are preserved by default) |
I'm also running into this issue. I may be able to take a stab at implementing what @bashbunni is describing if she isn't doing so already. |
Depending on what you actually need, you can also just initialize a new |
By setting |
OK, I took a stab at adding this feature the library but ran into some problems while trying to maintain the current functionality. To better wrap my head around the problem, I implemented the wrapping functionality I need in my own project. I'm still open to porting this functionality back into this project if it's something the author wants. |
ANSI aware text wrapping that breaks word boundaries only when necessary. Fixes: charmbracelet/lipgloss#275 Fixes: muesli/reflow#43
ANSI aware text wrapping that breaks word boundaries only when necessary. Fixes: charmbracelet/lipgloss#275 Fixes: muesli/reflow#43
ANSI aware text wrapping that breaks word boundaries only when necessary. Fixes: charmbracelet/lipgloss#275 Fixes: muesli/reflow#43
Uses `ansi.SmartWrap` charmbracelet/x#57 Fixes: muesli/reflow#43
ANSI aware text wrapping that breaks word boundaries only when necessary. Fixes: charmbracelet/lipgloss#275 Fixes: muesli/reflow#43
Uses `ansi.SmartWrap` charmbracelet/x#57 Fixes: muesli/reflow#43
ANSI aware text wrapping that breaks word boundaries only when necessary. Fixes: charmbracelet/lipgloss#275 Fixes: muesli/reflow#43
ANSI aware text wrapping that breaks word boundaries only when necessary. Fixes: charmbracelet/lipgloss#275 Fixes: muesli/reflow#43
Uses `ansi.SmartWrap` charmbracelet/x#57 Fixes: muesli/reflow#43
Uses `ansi.SmartWrap` charmbracelet/x#57 Fixes: muesli/reflow#43
* feat(term): ansi: add SmartWrap ANSI aware text wrapping that breaks word boundaries only when necessary. Fixes: charmbracelet/lipgloss#275 Fixes: muesli/reflow#43 * refactor(term): ansi: rename wrap functions
* feat: switch to term/ansi for text manipulation Use ANSI aware, wide characters support, uniseg backed term/ansi package to calculate string widths, truncate, and wrap strings. Related: muesli/reflow#71 Fixes: #258 Fixes: #220 * fix: combining both conditional and unconditional wrapping Uses `ansi.SmartWrap` charmbracelet/x#57 Fixes: muesli/reflow#43 * chore: update deps * Update get.go
When combining word-wrapping with unconditional wrapping as described in the README, extra linebreaks can sometimes be found in the output.
For example:
Outputs:
However, I'd expect it to be:
Playground Example
The text was updated successfully, but these errors were encountered: