Closed zimxavier closed 7 years ago
Hm. I just found the solution, I guess. Sorry.
"file_path": ".*\\\\Game\\\\common\\\\countries\\.txt$"
It appears I spoke too soon. The syntax highlighting for the files at the root of countries is not loaded. Any help?
The reason why flags get rendered with countries syntax is because of your regex. This is not a problem with ApplySyntax. You have a regex that grabs any file under countries (even files under flags). And since that rule comes before the flags rule, it will always consume files under flags.
{"file_path": ".*\\\\Game\\\\common\\\\countries\\\\.*\\.txt$"}
Notice you path uses things like countries\\\\.*\\.txt
which says you'll take any file under countries. Even countries\flags\somefile.txt
because you used .*
which grabs any character. If you used something like [^\\]*
you would avoid anything under countries with \
(like folders).
Apparently, [^\\]*
doesn't work. [^\\\\]*
works though:
{"file_path": ".*\\\\Game\\\\common\\\\countries\\\\[^\\\\]*\\.txt$"}
Thank you.
Yeah, sorry. That's what I meant.
Hi,
I would like to associate files at the root of the folder countries with a syntax file, and files in the subdirectory flags with another one. Unfortunately, I don't master the required syntax and ST load files in flags with the syntax highlighting for countries.
Game\common\countries\
How can I exclude files in subdirectories?
Thank you for your plugin :) And for any help.