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