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
The tricky part that it's not a 100% accurate fix. In PS it's legal to write -not1 and 1-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 -bla keywords. It's pretty easy to introduce new bugs, when implementing this, so I would prefer implement it with reasonable test coverage.
Activity
vors commentedon Dec 6, 2014
This 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
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.@guillermooo what do you think?
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.bcrotty commentedon Feb 18, 2015
Fixed as of 2.1.0