Closed foresterre closed 1 year ago
Sorry for the regression, and thanks for the report and fix! I'm going to merge and release this -- it would be great if you are able to add a test that covers this behavior somehow.
it would be great if you are able to add a test that covers this behavior somehow
Agreed! I did try to create a test case, but didn't get it to fail properly yet, which is weird 🙃. I expected that pb.println("<ansii color escape sequence>"); pb.tick();
would work (as this is what I saw in my program), but somehow it didn't.
I'll have another try tonight.
I added a test 🙂.
I removed the commit which added the same as #549, and rebased on main.
Great work, thanks!
If console::measure_text_width returns 0, the line is effectively empty, although line.is_empty() may still be false. This can for example happen when there is a line which just consists of ANSI color escape sequences.
I hope I didn't undo the work done in #533.
An alternative would be to do:
closes #546