reflow icon indicating copy to clipboard operation
reflow copied to clipboard

wordwrap should reset and restore ansi at linebreak

Open treilik opened this issue 3 years ago • 10 comments

ansi-sequence should end at linebreak and start again after it if there is more text, in the next line.

treilik avatar Oct 07 '20 11:10 treilik

@treilik Not sure you're aware of this, but the test fails in CI.

lukasmalkmus avatar Oct 18 '20 16:10 lukasmalkmus

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.

treilik avatar Oct 25 '20 08:10 treilik

Ups, yes. Should have just looked at your changes :)

Looking forward to your solution :)

lukasmalkmus avatar Oct 25 '20 22:10 lukasmalkmus

@lukasmalkmus here you go ;)

If you have some thoughts on this, i would love to here them!

treilik avatar Oct 27 '20 08:10 treilik

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 :)

lukasmalkmus avatar Oct 27 '20 23:10 lukasmalkmus

Didn't noted the linter issues, so i will get to it. Thank you :)

treilik avatar Oct 29 '20 07:10 treilik

@treilik Whenever you consider this ready for a review, feel free to remove the Draft flag!

muesli avatar Oct 29 '20 07:10 muesli

Hey @muesli, if you could spare the time, i would now be happy for a review :)

treilik avatar Nov 15 '20 16:11 treilik

Hey there - is there any progress here? would be nice to get this soon - otherwise my CLI-application craftamap/bb has some rendering issues

craftamap avatar Dec 14 '20 17:12 craftamap

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!

treilik avatar Mar 11 '21 12:03 treilik