Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/syntax.rs')
| -rw-r--r-- | helix-core/src/syntax.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index ac689eb3..8fa185c6 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -864,12 +864,8 @@ impl TextObjectQuery { .iter() .find_map(|cap| self.query.get_capture(cap))?; - let mut cursor = InactiveQueryCursor::new(); - // TODO: this line can be dropped when we update tree-house to automatically reset cursors - // back to defaults when reusing them from the cursor cache. - cursor.set_byte_range(0..u32::MAX); - cursor.set_match_limit(TREE_SITTER_MATCH_LIMIT); - let mut cursor = cursor.execute_query(&self.query, node, RopeInput::new(slice)); + let mut cursor = InactiveQueryCursor::new(0..u32::MAX, TREE_SITTER_MATCH_LIMIT) + .execute_query(&self.query, node, RopeInput::new(slice)); let capture_node = iter::from_fn(move || { let (mat, _) = cursor.next_matched_node()?; Some(mat.nodes_for_capture(capture).cloned().collect()) |