aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-08-13 04:15:10 +0000
committerBlaž Hrastnik2021-08-13 04:15:53 +0000
commit7c834d6506afca0d010bb34cfab410f754877b1e (patch)
tree6d08f3982d7dd442ca2bf6d3dbb0132e89c07334 /helix-core
parent9a39a10ddd5d8cf87e4ecedd54c4f4e06735ba33 (diff)
fix: tree sitter rendering glitches with multiple selection edits
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/syntax.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 60d44976..4bceb73b 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -656,8 +656,10 @@ impl LanguageLayer {
let edits = Self::generate_edits(old_source.slice(..), changeset);
// Notify the tree about all the changes
- for edit in edits {
- self.tree.as_mut().unwrap().edit(&edit);
+ for edit in edits.iter().rev() {
+ // apply the edits in reverse. If we applied them in order then edit 1 would disrupt
+ // the positioning of edit 2
+ self.tree.as_mut().unwrap().edit(edit);
}
self.parse(