reflow
reflow copied to clipboard
wordwrap should reset and restore ansi at linebreak
ansi-sequence should end at linebreak and start again after it if there is more text, in the next line.
@treilik Not sure you're aware of this, but the test fails in CI.
Thank you @lukasmalkmus, I am aware ;) I first changed the test, to what i think, should be the behavior of wordwrap and now i'am still working on the change, to satisfy the test I have changed.
Ups, yes. Should have just looked at your changes :)
Looking forward to your solution :)
@lukasmalkmus here you go ;)
If you have some thoughts on this, i would love to here them!
Looks good to me, but I'm not that deep into the materia :) Make sure to fix the linter issues which are annotated in the Changes
view and probably ask @muesli for a review :)
Didn't noted the linter issues, so i will get to it. Thank you :)
@treilik Whenever you consider this ready for a review, feel free to remove the Draft
flag!
Hey @muesli, if you could spare the time, i would now be happy for a review :)
Hey there - is there any progress here? would be nice to get this soon - otherwise my CLI-application craftamap/bb has some rendering issues
Hey muesli! so i would dare to say i am finally finished :) if you would like to first get an overview of the change in behavior, have a look into the diff of the test-file. and than: Into the code! The core change is here in line 195 of wordwrap.go you find the case of a rune which overflows the line-limit and thus causes a new line, maybe note also the change in the adding of pending spaces if the line is not long enough for all the spaces: in line 85 of wordwrap.go in this diff. The later commits are handling linting and some edge-cases like leading and interposed zero ansi-arguments or multiple hyphens.
Cheers!