aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/transaction.rs
diff options
context:
space:
mode:
authorPascal Kuthe2023-02-09 07:19:29 +0000
committerGitHub2023-02-09 07:19:29 +0000
commit7ebcf4e919a27b60610ba8f3a24a213282eb9ee6 (patch)
treececdae3f902af192ddb5adb8b3202f060f88bfa4 /helix-core/src/transaction.rs
parent8a602995fa71bee009c0ab1e67b78828a731ca75 (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.rs5
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);