You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unicode characters can be fullwidth, which takes the same space as two normal characters. This isn't taken into account when printing right now. A method was abstracted away to /Src/CSharpier/Utilities/StringExtensions.cs that can be modified to implement this feature.
belav
changed the title
Implement GetPrintedWidth() to properly handle special characters.
Fullwidth unicode characters should be accounted for in width
Feb 4, 2023
belav
changed the title
Fullwidth unicode characters should be accounted for in width
Fullwidth unicode characters should be accounted for in print width
Feb 4, 2023
Unicode characters can be fullwidth, which takes the same space as two normal characters. This isn't taken into account when printing right now. A method was abstracted away to /Src/CSharpier/Utilities/StringExtensions.cs that can be modified to implement this feature.
See https://github.com/prettier/prettier/blob/main/src/utils/get-string-width.js for how prettier does it.
There doesn't seem to be much about this that I can find in c#/.net
https://stackoverflow.com/questions/65410411/how-to-reliably-determine-the-width-of-a-character-in-c
The text was updated successfully, but these errors were encountered: