Skip to content

Commit

Permalink
fix(auto_pairs): fix auto pairs with crlf
Browse files Browse the repository at this point in the history
Auto pairs were resulting in incorrect ranges in the resulting when the
line terminators are CRLF (i.e. Windows). It turns out this is because
when we were checking if the selection was a single-width cursor, it
incorrectly assumed that this would be a single char. This is not the
case, as a cursor can cover a multi-code point grapheme. Therefore,
we must instead explicitly work with and check graphemes to determine
if the cursor should move or extend the selection.

Fixes #1436
  • Loading branch information
dead10ck committed Jan 10, 2022
1 parent e0a99ae commit 197748b
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 41 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions helix-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ chrono = { version = "0.4", default-features = false, features = ["alloc", "std"

[dev-dependencies]
quickcheck = { version = "1", default-features = false }
fern = "0.6"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
Loading

0 comments on commit 197748b

Please sign in to comment.