Skip to content

Wrapping around combined emojisΒ #78

@MarcusBilo

Description

@MarcusBilo

Due to the use of mattn/go-runewidth, the wrapping function is potentially faulty. This is because mattn/go-runewidth returns the uncollapsed length for strings containing combined emojis such as β€œπŸ‘πŸΌπŸ!”.

This has been known for a long time and was discussed here. If the renderer does not collapse the emojis, the length returned by mattn/go-runewidth would actually be correct. However, since this occurs very rarely in my opinion, the value normally returned is incorrect. This is not a direct bug, but it should definitely be a more prominently highlighted functionality due to the fact that it can lead to strange errors in a TUI that are not easy to pinpoint – if you don't know about this, you probably won't test the correctness of the returned length of a string as a early step.

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