Render the SGR "underlined" attribute in the style of the font#7148
Render the SGR "underlined" attribute in the style of the font#71483 commits merged intomicrosoft:masterfrom
Conversation
|
@msftbot make sure @zadjii-msft signs off |
|
Hello @DHowett! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
|
See, this is way more comprehensive than my "2 files changed" hack hour 😄 Thanks @j4james |
|
(don't mind me editing your pr bodies -- it's purely aesthetic for when the bot takes over the merge 😄) |
|
🎉 Handy links: |
This PR updates the rendering of the underlined graphic rendition
attribute, using the style specified in the active font, instead of just
reusing the grid line at the bottom of the character cell.
renderer was added in Refactor grid line renderers with support for more line types #7107.
There was already an
ExtendedAttributesflag defined for theunderlined state, but I needed to update the
SetUnderlinedandIsUnderlinedmethods in theTextAttributeclass to use that flagnow in place of the legacy
LVB_UNDERSCOREattribute. This enablesunderlines set via a VT sequence to be tracked separately from
LVB_UNDERSCOREgrid lines set via the console API.I then needed to update the
Renderer::s_GetGridlinesmethod toactivate the
GridLines::Underlinestyle when theUnderlinedattribute was set. The
GridLines::Bottomstyle is still triggered bythe
LVB_UNDERSCOREattribute to produce the bottom grid line effect.Validation
Because this is a change from the existing behaviour, certain unit tests
that were expecting the
LVB_UNDERSCOREto be toggled bySGR 4andSGR 24have now had to be updated to check theUnderlinedflaginstead.
There were also some UI Automation tests that were checking for
SGR 4mapping to
LVB_UNDERSCOREattribute, which I've now substituted with atest of the
SGR 53overline attribute mapping toLVB_GRID_HORIZONTAL. These tests only work with legacy attributes, sothey can't access the extended underline state, and I thought a
replacement test that covered similar ground would be better than
dropping the tests altogether.
As far as the visual rendering is concerned, I've manually confirmed
that the VT underline sequences now draw the underline in the correct
position and style, while grid lines output via the console API are
still displayed in their original form.
Closes #2915