aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
authorNathan Vegdahl2021-07-02 02:01:34 +0000
committerNathan Vegdahl2021-07-02 02:06:52 +0000
commit9f62ad0715240156b512dfc7c584d2d0df05a664 (patch)
tree72d25c7f57ff517f61698981ccb05f456fe6ccfe /helix-core
parentc389f41f1430e5ce39682eda4425553f3ba129d4 (diff)
Fixed last `unused` warning.
Diffstat (limited to 'helix-core')
-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;