diff options
author | Pascal Kuthe | 2023-02-09 07:19:29 +0000 |
---|---|---|
committer | GitHub | 2023-02-09 07:19:29 +0000 |
commit | 7ebcf4e919a27b60610ba8f3a24a213282eb9ee6 (patch) | |
tree | cecdae3f902af192ddb5adb8b3202f060f88bfa4 /helix-core/src/transaction.rs | |
parent | 8a602995fa71bee009c0ab1e67b78828a731ca75 (diff) |
properly handle LSP position encoding (#5711)
* properly handle LSP position encoding
* add debug assertion to Transaction::change
* Apply suggestions from code review
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
---------
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Diffstat (limited to 'helix-core/src/transaction.rs')
-rw-r--r-- | helix-core/src/transaction.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index 482fd6d9..d2f4de07 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -481,6 +481,11 @@ impl Transaction { for (from, to, tendril) in changes { // Verify ranges are ordered and not overlapping debug_assert!(last <= from); + // Verify ranges are correct + debug_assert!( + from <= to, + "Edit end must end before it starts (should {from} <= {to})" + ); // Retain from last "to" to current "from" changeset.retain(from - last); |