You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a context is pushed onto the stack by (?=\S) a lookahead which points to a word (e.g.: (?=import\b)) is ignored when evaluating the next nonwhitespace character.
Note: If the (?=import\b) was replaced by import\b it was evaluated, but then breaking the syntax due to popping without pushing back into the context.
Steps to reproduce
Open a vanilla ST.
Create a new syntax and past the snippet below.
Create an empty file and assign it the new syntax.
Type several lines of import.
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.htmlname: Lookaheadscope: source.lookaheadcontexts:
main:
- match: import\bscope: keyword.control.directivepush:
- meta_scope: meta.preprocessor.import
- match: (?=\S)push:
- meta_content_scope: meta.path
- match: (?=import\b) # not evaluated for the first word after "import"!pop: 2
- match: ;scope: punctuation.terminatorpop: 2
- match: \w+\bscope: entity.name.class
Expected behavior
Each import keyword should be scoped as keyword.control.directive
Actual behavior
Each 2nd import keyword is scoped/highlighted as entity.name.class, because the (?=import\b) lookahread in line 15 is not evaluated and therefore the bail out does not work.
Environment
Build: 4061
Operating system and version: Windows 10 x64 1903
The text was updated successfully, but these errors were encountered:
This has been added in build 4075. There is now more complex logic to handle situations where pushes and pops are asymmetrical, and thus can be allowed even though both are zero-width.
Description
If a context is pushed onto the stack by
(?=\S)
a lookahead which points to a word (e.g.:(?=import\b)
) is ignored when evaluating the next nonwhitespace character.Note: If the
(?=import\b)
was replaced byimport\b
it was evaluated, but then breaking the syntax due to popping without pushing back into the context.Steps to reproduce
import
.Expected behavior
Each
import
keyword should be scoped askeyword.control.directive
Actual behavior
Each 2nd
import
keyword is scoped/highlighted asentity.name.class
, because the(?=import\b)
lookahread in line 15 is not evaluated and therefore the bail out does not work.Environment
The text was updated successfully, but these errors were encountered: