Skip to content

emojis/nonstandard characters mess up alignment #15

@yo1dog

Description

@yo1dog

This is due to an underlying issue with vscode: microsoft/vscode#100730

There is no way to know how wide a character will be when displayed in vscode. It is completely up to the render engine with many environmental variables involved (font, ligatures, grapheme clustering, etc.). A character may even have a fractional width! Thus, there are some scenarios that are simply impossible to align correctly.

For example, this emoji 👨‍👩‍👦‍👦 is actually 7 characters: U+1F468 U+200D U+1F469 U+200D U+1F466 U+200D U+1F466. In vscode, placing the cursor after this emoji advances the column position by 7, indicating that it would take up the width of 7 characters. However, visually the emoji spans about 2.2 characters.

On the flip side, the Japanese Kanji for man 男 is the single character U+7537, advances the cursor column position by 1, yet visually spans about 1.9 columns.

Image

As such, there is nothing this extension can do to solve this problem. This issue will be left open for informational purposes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions