Skip to content

Commit b31e5b5

Browse files
authored
Add negative lookahead to foreach and where
And remove foreach-object and where-object from keyword.control.powershell because they are covered in support.function.powershell
1 parent 4e9b56d commit b31e5b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,13 @@
248248
</dict>
249249
<dict>
250250
<key>match</key>
251-
<string>(?&lt;!\w|-|\.)((?i:begin|break|catch|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|foreach-object|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|var|where-object|while)|%|\?)(?!\w)</string>
251+
<string>(?&lt;!\w|-|\.)((?i:begin|break|catch|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|var|while)|%|\?)(?!\w)</string>
252252
<key>name</key>
253253
<string>keyword.control.powershell</string>
254254
</dict>
255255
<dict>
256256
<key>match</key>
257-
<string>(?&lt;!\w|-|[^\)]\.)((?i:foreach|where)|%|\?)(?!\w)</string>
257+
<string>(?&lt;!\w|-|[^\)]\.)((?i:(foreach|where)(?!-object))|%|\?)(?!\w)</string>
258258
<key>name</key>
259259
<string>keyword.control.powershell</string>
260260
</dict>

0 commit comments

Comments
 (0)