Skip to content

Commit

Permalink
Fix bug in changed_ranges
Browse files Browse the repository at this point in the history
The order here matters!
  • Loading branch information
th0rex committed Dec 13, 2019
1 parent 15d74d1 commit 6bed1e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tree.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use emacs::{defun, Value, Result, Vector};
use emacs::{defun, Result, Value, Vector};

use tree_sitter::{InputEdit, Tree};

Expand Down Expand Up @@ -63,7 +63,7 @@ fn changed_ranges<'e>(tree: Value<'e>, old_tree: Borrowed<'e, Tree>) -> Result<V
let env = tree.env;
let tree = tree.into_rust::<Borrowed<Tree>>()?.borrow();
let other_tree = old_tree.borrow();
let ranges = tree.changed_ranges(&*other_tree);
let ranges = other_tree.changed_ranges(&*tree);
let vec = env.make_vector(ranges.len(), ())?;
for (i, range) in ranges.enumerate() {
vec.set(i, Range(range))?;
Expand Down

0 comments on commit 6bed1e1

Please sign in to comment.