[quote=“nick.”]A tutorial isn’t really necessary. If the scope you expect isn’t the scope of the text, it’s overwritten.
Suppose I have the following text:
def my_function():
pass
And suppose this is the entire syntax definition:
[code]
name
entity.name.function.python
match
def [A-Za-z0-9_]+\s*(
name
my-function.python
match
def my_function\(
[/code]
Q: Which scope gets applied?
A: entity.name.function.python since it comes first in the syntax definition and successfully matches the line.
You can press CTRL+ALT+SHIFT+P to view the scope of any character, or use a plugin like ScopeHunter. The point is, you need to know if your scope is the active for the text.[/quote]
I gathered it wasn’t active at all before that, from using the scope find command.
But what’s interesting to me is, from what you said it’s not a selector at all: e.g. even though one may match more specifically, it’s still “whatever comes first”. Or am I misreading that? So, if I’m reading you correctly, you answered my original question: nested scopes doesn’t work.
I also tried out your regex, feel free to take a look at my files:
gist.github.com/3718188