|
|
@ -2475,15 +2475,17 @@ impl<'a> Iterator for HighlightIter<'a> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Once a highlighting pattern is found for the current node, skip over
|
|
|
|
// Use the last capture found for the current node, skipping over any
|
|
|
|
// any later highlighting patterns that also match this node. Captures
|
|
|
|
// highlight patterns that also match this node. Captures
|
|
|
|
// for a given node are ordered by pattern index, so these subsequent
|
|
|
|
// for a given node are ordered by pattern index, so these subsequent
|
|
|
|
// captures are guaranteed to be for highlighting, not injections or
|
|
|
|
// captures are guaranteed to be for highlighting, not injections or
|
|
|
|
// local variables.
|
|
|
|
// local variables.
|
|
|
|
while let Some((next_match, next_capture_index)) = captures.peek() {
|
|
|
|
while let Some((next_match, next_capture_index)) = captures.peek() {
|
|
|
|
let next_capture = next_match.captures[*next_capture_index];
|
|
|
|
let next_capture = next_match.captures[*next_capture_index];
|
|
|
|
if next_capture.node == capture.node {
|
|
|
|
if next_capture.node == capture.node {
|
|
|
|
captures.next();
|
|
|
|
match_.remove();
|
|
|
|
|
|
|
|
capture = next_capture;
|
|
|
|
|
|
|
|
match_ = captures.next().unwrap().0;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|