-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge the legacy and extended attributes (#14036)
This PR attempts to simplify the `TextAttribute` class by merging the two fields that were previously storing the "legacy" attributes and the "extended" attributes separately. When the `TextAttribute` class is initialized with a legacy value, we were masking off the `META_ATTRS` bits to store in the `_wAttrLegacy` field, and then additionally clearing the `COMMON_LVB_SBCSDBCS` bits, so there were only 5 bits that were actually used in the end. We also had an additional `_extendedAttrs` field holding other VT attributes, which only used 8 of its available 16 bits. In this PR I've now merged the the two sets of attributes into one enum, so they all fit in a single 16-bit value. The legacy attributes retain the same bit positions they originally had, so we can mask them off from an incoming legacy value as we did before. I've just simplified the process somewhat by creating a `USED_META_ATTRS` mask that covers the exact subset of meta attributes that we care about. The new enum that holds the combined attributes has now been named `CharacterAttributes` rather than `ExtendedAttributes`, since that seems to be the term typically used in VT documentation. This covers both rendition/visual attributes and logical attributes (not yet used, but we will need them at some point to support selective erase operations). While making these changes I also noticed the `IsLeadingByte` and `IsTrailingByte` methods weren't actually used anywhere, and weren't correctly implemented anyway, so I've removed those now. ## Validation Steps Performed I've manually run a number of attribute test scripts which cover both legacy and VT operations, and everything still appears to be working correctly. Closes #14031
- Loading branch information
Showing
7 changed files
with
85 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.