Don't remove spaces when printing a new bottom line with a background color#5550
Conversation
DHowett-MSFT
left a comment
There was a problem hiding this comment.
I'm not sure I understand why we're hitting the "optimize spaces" case between two other characters.
Also, do you think it would be possible to save the whole TextAttribute and use the HasIdenticalVisualRepresentationForBlankSpace function? It takes care of cases like global and local inverse (which James pointed out) which I think could be a ... problem .. here
nevermind, it won't be a problem here because we're using the COLORREFs and we've lost text attribute info by this point (#2661)
Caching more state always scares me :)
|
So in this case, the row we're printing is separated into two runs:
It's that first run's 9 spaces that we tried to optimize with the ECH. I could certainly see us needing to cache more info, but maybe that's just something we should handle in #2661 when we have all the info in one nice blob |
DHowett-MSFT
left a comment
There was a problem hiding this comment.
I don't love it, but it works and that's more important than ideology.
miniksa
left a comment
There was a problem hiding this comment.
This spaghetti is killing me, but if it works, I have to agree with Dustin and just let it go. At least there are more tests than we had two months ago before this started so we might have some hope of making this less gross in the future.
|
Hello @DHowett-MSFT! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…ackground-colors-after-circling
|
Wow -- merging master actually broke the test (???) Sorry :( |
|
🎉 Handy links: |
Turns out we're still being a bit too aggressive when removing spaces.
If there are spaces at the end of the first run painted to a bottom
line, and the bottom line was a different color than the previous,
then we can't trim those spaces off the string. We still need to emit
those to make sure the terminal has colored spaces in it as well.
References
PR Checklist
Validation Steps