fix: Need to reset set_byte_range in case cursor_ref is reused.

pull/754/head
Blaž Hrastnik 3 years ago
parent 32977ed341
commit 066367c0a4

@ -372,10 +372,8 @@ impl Syntax {
let config_ref = let config_ref =
unsafe { mem::transmute::<_, &'static HighlightConfiguration>(self.config.as_ref()) }; unsafe { mem::transmute::<_, &'static HighlightConfiguration>(self.config.as_ref()) };
// TODO: if reusing cursors this might need resetting // if reusing cursors & no range this resets to whole range
if let Some(range) = &range { cursor_ref.set_byte_range(range.clone().unwrap_or(0..usize::MAX));
cursor_ref.set_byte_range(range.clone());
}
let captures = cursor_ref let captures = cursor_ref
.captures(query_ref, tree_ref.root_node(), RopeProvider(source)) .captures(query_ref, tree_ref.root_node(), RopeProvider(source))

Loading…
Cancel
Save