fix: tree sitter rendering glitches with multiple selection edits

pull/578/head
Blaž Hrastnik 3 years ago
parent 9a39a10ddd
commit 7c834d6506

@ -656,8 +656,10 @@ impl LanguageLayer {
let edits = Self::generate_edits(old_source.slice(..), changeset); let edits = Self::generate_edits(old_source.slice(..), changeset);
// Notify the tree about all the changes // Notify the tree about all the changes
for edit in edits { for edit in edits.iter().rev() {
self.tree.as_mut().unwrap().edit(&edit); // 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( self.parse(

Loading…
Cancel
Save