aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-core/src/syntax.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 9ecc55e8..9dbb2c03 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -567,7 +567,6 @@ impl LanguageLayer {
) -> Vec<tree_sitter::InputEdit> {
use Operation::*;
let mut old_pos = 0;
- let mut new_pos = 0;
let mut edits = Vec::new();
@@ -611,9 +610,7 @@ impl LanguageLayer {
let mut old_end = old_pos + len;
match change {
- Retain(_) => {
- new_pos += len;
- }
+ Retain(_) => {}
Delete(_) => {
let (start_byte, start_position) = point_at_pos(old_text, old_pos);
let (old_end_byte, old_end_position) = point_at_pos(old_text, old_end);
@@ -637,8 +634,6 @@ impl LanguageLayer {
Insert(s) => {
let (start_byte, start_position) = point_at_pos(old_text, old_pos);
- let ins = s.chars().count();
-
// a subsequent delete means a replace, consume it
if let Some(Delete(len)) = iter.peek() {
old_end = old_pos + len;
@@ -666,8 +661,6 @@ impl LanguageLayer {
new_end_position: traverse(start_position, s), // old pos + chars, newlines matter too (iter over)
});
}
-
- new_pos += ins;
}
}
old_pos = old_end;