Closed FichteFoll closed 7 years ago
This is not a bug as we can see from this example,
Sublime Text is accepting capture groups inside look ahead. You can try it out with (look)(?=(ing))\2
, which makes Sublime Text to correctly apply scopes for the capture group inside the look ahead:
%YAML 1.2
---
name: test
scope: source.syntax_name
contexts:
main:
- match: '(look)(?=(ing))\2'
captures:
1: first.looking.assignment
2: second.looking.assignment
push:
- meta_scope: third.looking.assignment
- match: '(?=ing)'
scope: forth.looking.assignment
- match: ''
pop: true
Sublime text is just not applying any scope to the text if the text is not eaten by the regular expression. Here bellow we see the scopes being correctly applied by Sublime Text one the `\2
was introduced to the original regular expression.
Via https://github.com/SublimeTextIssues/Core/issues/1796#issuecomment-313269920, this is actually the proper behavior and thus not a bug.
via https://github.com/SublimeTextIssues/Core/issues/1796#issuecomment-312920245