-
Notifications
You must be signed in to change notification settings - Fork 82
Description
The word break problem shows up on other keyword-prefixes (like
-bxor)
I investigated it and there is a simple fix: add\bfor word boundaryhttps://github.com/SublimeText/PowerShell/blob/dev/Support/PowershellSyntax.tmLanguage#L265
- <string>-(?i:and|or|not|xor)|!</string> + <string>-(?i:and|or|not|xor)\b|!</string>The tricky part that it's not a 100% accurate fix. In PS it's legal to write
-not1and1-bxor1, without spaces.A proper fix will be relatively complicated: we need to recognize that context implies function call and turn-off keyword highlighting for all
-blakeywords. It's pretty easy to introduce new bugs, when implementing this, so I would prefer implement it with reasonable test coverage.PS:
-not1ideally should be recognized correctly (highlight -not part), but I have no idea how to do it without using PS parser or over-engineering.