Closed tgolsson closed 6 months ago
Thanks for working on this!
Can we share the code with draw_target
somehow, so that it is more obviously using the same algorithm?
If we're going to move this I'd like to see two separate commits, one that moves/renames the code and one that changes the algorithm. Ideally tests that work with the old algorithm are introduced before this, and then the fixing commit adds tests that didn't work previously -- this will make it easy for me to review. (Please squash linting changes etc.)
Can we share the code with draw_target somehow, so that it is more obviously using the same algorithm?
Doesn't seem like a worthwhile change seeing as that is counting lines while drawing, while this does it ahead of time.
If we're going to move this I'd like to see two separate commits, one that moves/renames the code and one that changes the algorithm. Ideally tests that work with the old algorithm are introduced before this, and then the fixing commit adds tests that didn't work previously -- this will make it easy for me to review. (Please squash linting changes etc.)
Please see new commits -- first commit moves + add working tests, second commit adds the failing tests, third commit fixes the failing tests.
CI seems like a flake, can't repro at all locally.
Fixes #606 -- see added test cases. This logic matches what happens
draw_target.rs
as well. It'll now also correctly handle lines with only ANSI codes.https://github.com/console-rs/indicatif/blob/81aa4c65d7202128d471b3a452a0236e03f3bc43/src/draw_target.rs#L505-L518