-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Remove dependency on IsGlyphFullWidth for IRM/DECSWL #16903
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.
Amazing! I see a lot of tests moved to use Replace
as well... which makes me think that we should have tests for Insert
, right?
I fear you may have mistaken COOKED_READ_DATA for tests since it's so repetitive. Currently We do have a pretty good unit test coverage of |
I sure did! |
if (_modes.test(Mode::InsertReplace)) | ||
{ | ||
textBuffer.Insert(cursorPosition.y, attributes, state); | ||
} |
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.
This isn't working correctly when you have horizontal margins set. If you're inserting text while inside the margins, the content that is pushed to the right should only move as far as the right margin. I didn't look at the implementation that closely, but I'm guessing the Insert
method is not taking the state.columnLimit
into account.
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.
Test case in pwsh:
"`e7`e[?69h`e[1;20s`e8*`e[19b`r`e[4h `e[19b`e[4l`e[s`e8`n"
That should produce what is effectively a blank line, but instead we're seeing 20 *
characters offset by 20 columns.
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.
I believe I fixed this issue. Thanks!
I noticed that after running your test string, TextBuffer::SetCurrentLineRendition
won't get called anymore. Is that to be expected? (It does work again after emitting a RIS.)
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.
I didn't think about that, but that is actually correct. When the horizontal margin mode is enabled, line renditions are disabled. I should have reset mode ?69 at the end of that test case.
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.
I think I trust this?
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.
Test
{ | ||
return WEX::Common::NoThrowString(object.to_string().c_str()); | ||
} | ||
}; |
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.
...yes. 😑
Let me know if you dislike this removal. rle_vector
uses strstream like all the other classes and TextAttribute
has no string-serializer. I just removed it because it was easier. I could however write a full ToString
method here if we want to.
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 honestly I don't particularly care for all of these
This gets rid off the implicit dependency on
IsGlyphFullWidth
for the IRM and DECSWL/DECDWL/DECDHL implementations.
Validation Steps Performed
In pwsh:
"`e[31mab`e[m`b`e[4h`e[32m$('*'*10)`e[m`e[4l"
prints a red "a", 10 green "*" and a red "b" ✅
"`e[31mab`e[m`b`e[4h`e[32m$('*'*1000)`e[m`e[4l"
prints a red "a" and a couple lines of green "*" ✅
"`e[31mf$('o'*70)`e[m`e#6`e#5"
the right half of the row is erased ✅