Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multi byte auto pairs #4024

Merged
merged 4 commits into from
Oct 21, 2022

Commits on Oct 20, 2022

  1. Fix test::print for Unicode

    The print function was not generating correct translations when
    the input has Unicode (non-ASCII) in it. This is due to its use of
    String::len, which gives the length in bytes, not chars.
    dead10ck committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    670ee61 View commit details
    Browse the repository at this point in the history
  2. Fix multi-code point auto pairs

    The current code for auto pairs is counting offsets by summing the
    length of the open and closing chars with char::len_utf8. Unfortunately,
    this gives back bytes, and the offset needs to be in chars.
    
    Additionally, it was discovered that there was a preexisting bug where
    the selection was not computed correctly in the case that the cursor
    was:
    
    1. a single grapheme in width
    2. this grapheme was more than one char
    3. the direction of the cursor is backwards
    4. a secondary range
    
    In this case, the offset was not being added into the anchor. This was
    fixed.
    dead10ck committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    075bf5d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7a6484e View commit details
    Browse the repository at this point in the history
  4. review comments

    dead10ck committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    b634666 View commit details
    Browse the repository at this point in the history