Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Editor scroll width is miscalculated when longest line has variable-width characters #2666

Closed

Description

@nathansobo

Investigating #2659, I realized that we base the scroll width of the editor on the length of the longest line multiplied by the default character width, which is incorrect in the presence of variable-width characters. We need to determine the longest line's length by totaling the real-world width of its characters.

In the example below, I have a js file with a single line containing multiple while keywords. Using Atom Light UI and Inconsolata as my font, the while keywords are bold and have characters that are slightly wider than the default. The result is an inability to scroll to the end of the rendered line.

scroll width calc

Activity

  1. lee-dohm commented on Jun 19, 2014

    @lee-dohm
    Contributor

    Is this essentially the same root cause as the CJK character issues, #1783, too?

  2. nathansobo commented on Jun 19, 2014

    @nathansobo
    ContributorAuthor

    @lee-dohm Yes, it's a very similar issue. In those cases it's even worse because we're wrapping at 80 characters and I think the JS string length is incorrect in the presence of multi-byte characters. But variable width is also broken for soft wrap. What we really need to do is add up the length of the line based on the width of the on-screen glyphs to which it maps. We need to do a pass on the entire rendering pipeline with multibyte and variable width chars in mind.

  3. lock commented on Jan 26, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  4. locked as resolved and limited conversation to collaborators on Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions