Skip to content
Snippets Groups Projects
Commit 756ed28d authored by George Nachman's avatar George Nachman
Browse files

Fix a bug where triggers would highlight lookahead matches. Only the first...

Fix a bug where triggers would highlight lookahead matches. Only the first range needs to be highlighted. That's the range of the string that matched the pattern. Additional ranges correspond to captures, not all of which are necessarily contained in the first range. Lookaheads fall outside the matched range and should not be highlihgted. Issue 5934.
parent 535b7358
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -427,14 +427,11 @@ enum {
onString:(iTermStringLine *)stringLine
atAbsoluteLineNumber:(long long)lineNumber
stop:(BOOL *)stop {
for (NSInteger i = 0; i < captureCount; i++) {
NSRange rangeInString = capturedRanges[i];
NSRange rangeInScreenChars = [stringLine rangeOfScreenCharsForRangeInString:rangeInString];
[[aSession screen] highlightTextInRange:rangeInScreenChars
basedAtAbsoluteLineNumber:lineNumber
colors:[self colors]];
}
NSRange rangeInString = capturedRanges[0];
NSRange rangeInScreenChars = [stringLine rangeOfScreenCharsForRangeInString:rangeInString];
[[aSession screen] highlightTextInRange:rangeInScreenChars
basedAtAbsoluteLineNumber:lineNumber
colors:[self colors]];
return YES;
}
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment