New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DBCS attribute corruption during reflow #12853
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newAttrColumn thing seems like it would regress the original bug we fixed.
We will not erroneously copy a DBCS Trailing Attribute to the edge of the screen, right? Or a leading one? |
I'll have to check! This PR could've been a draft tbh. 😅 |
{ | ||
try | ||
{ | ||
// TODO: MSFT: 19446208 - this should just use an iterator and the inserter... | ||
const auto textAttr = *attrs; | ||
const auto textAttr = row.GetAttrRow().GetAttrByColumn(copyAttrCol); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sad that this beautiful optimization had to die
const auto dbcsAttr = chars->DbcsAttr(); | ||
const auto textAttr = *attrs; | ||
const auto glyph = row.GetCharRow().GlyphAt(iOldCol); | ||
const auto dbcsAttr = row.GetCharRow().DbcsAttrAt(iOldCol); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah cause chars++
might skip two columns for something like an emoji, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think so.
So, here is my hope. WinDev is in "ask" mode locally, so I'm just gonna take this fix up during Ask for both Terminal and Console. |
Hello @DHowett! 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 (
|
855e136 contains a regression which breaks buffer reflow if wide surrogate characters are present. This happens because we made use of the `TextBufferCellIterator` whose increment operator skips 2 cells for wide characters. This created a "misalignment" in the reflow logic which was written for cell-wise iteration. This commit fixes the issue, by reverting back to the previous algorithm without iterators. Closes #12837 Closes MSFT-38904421 ## Validation Steps Performed * Run ``pwsh -noprofile -command echo "`u{D83D}`u{DE43}"`` * Resizing conhost preserves all contents ✅ * Resizing Windows Terminal doesn't crash it ✅ * Added a test covering this issue ✅ (cherry picked from commit 10b9044) Service-Card-Id: 80340089 Service-Version: 1.12
855e136 contains a regression which breaks buffer reflow if wide surrogate characters are present. This happens because we made use of the `TextBufferCellIterator` whose increment operator skips 2 cells for wide characters. This created a "misalignment" in the reflow logic which was written for cell-wise iteration. This commit fixes the issue, by reverting back to the previous algorithm without iterators. Closes #12837 Closes MSFT-38904421 ## Validation Steps Performed * Run ``pwsh -noprofile -command echo "`u{D83D}`u{DE43}"`` * Resizing conhost preserves all contents ✅ * Resizing Windows Terminal doesn't crash it ✅ * Added a test covering this issue ✅ (cherry picked from commit 10b9044) Service-Card-Id: 80340090 Service-Version: 1.13
🎉 Handy links: |
🎉 Handy links: |
855e136 contains a regression which breaks buffer reflow if wide surrogate characters are present. This happens because we made use of the `TextBufferCellIterator` whose increment operator skips 2 cells for wide characters. This created a "misalignment" in the reflow logic which was written for cell-wise iteration. This commit fixes the issue, by reverting back to the previous algorithm without iterators. Closes #12837 Closes MSFT-38904421 ## Validation Steps Performed * Run ``pwsh -noprofile -command echo "`u{D83D}`u{DE43}"`` * Resizing conhost preserves all contents ✅ * Resizing Windows Terminal doesn't crash it ✅ * Added a test covering this issue ✅ (cherry picked from commit 10b9044) Service-Card-Id: 80340091 Service-Version: Inbox
855e136 contains a regression which breaks buffer reflow if wide surrogate
characters are present. This happens because we made use of the
TextBufferCellIterator
whose increment operator skips 2 cells for widecharacters. This created a "misalignment" in the reflow logic which was written
for cell-wise iteration. This commit fixes the issue, by reverting back to the
previous algorithm without iterators.
Closes #12837
Closes MSFT-38904421
Validation Steps Performed
pwsh -noprofile -command echo "`u{D83D}`u{DE43}"