Skip to content

Commit a3609aa

Browse files
committed
remove non-local query matches for locals
1 parent 716ef24 commit a3609aa

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

highlight/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ struct HighlightIterLayer<'a> {
111111
scope_stack: Vec<LocalScope<'a>>,
112112
ranges: Vec<Range>,
113113
depth: usize,
114-
ignore_match_id: i32,
115114
}
116115

117116
impl Highlighter {
@@ -414,7 +413,6 @@ impl<'a> HighlightIterLayer<'a> {
414413
captures,
415414
config,
416415
ranges,
417-
ignore_match_id: -1,
418416
});
419417
}
420418

@@ -685,10 +683,6 @@ where
685683
let (mut match_, capture_index) = layer.captures.next().unwrap();
686684
let mut capture = match_.captures[capture_index];
687685

688-
if layer.ignore_match_id >= match_.id() as i32 {
689-
continue 'main;
690-
}
691-
692686
// If this capture represents an injection, then process the injection.
693687
if match_.pattern_index < layer.config.locals_pattern_index {
694688
let (language_name, content_node, include_children) =
@@ -841,7 +835,7 @@ where
841835
// highlighting patterns that are disabled for local variables.
842836
if definition_highlight.is_some() || reference_highlight.is_some() {
843837
while layer.config.non_local_variable_patterns[match_.pattern_index] {
844-
layer.ignore_match_id = match_.id() as i32;
838+
match_.remove();
845839
if let Some((next_match, next_capture_index)) = layer.captures.peek() {
846840
let next_capture = next_match.captures[*next_capture_index];
847841
if next_capture.node == capture.node {

0 commit comments

Comments
 (0)