diff --git a/PowerShell.sublime-syntax b/PowerShell.sublime-syntax index 7d3e927..6372d33 100644 --- a/PowerShell.sublime-syntax +++ b/PowerShell.sublime-syntax @@ -186,7 +186,7 @@ contexts: captures: 1: punctuation.definition.keyword.powershell # Flags/Options/Parameters - - match: \B([-/])\p{L}(?:[\w-]*\w)? + - match: \B(--?|[/+])\p{L}(?:[\w-]*\w)? scope: variable.parameter.option.powershell captures: 1: punctuation.definition.parameter.powershell diff --git a/Tests/syntax_test_PowerShell.ps1 b/Tests/syntax_test_PowerShell.ps1 index b67309c..bb9d932 100644 --- a/Tests/syntax_test_PowerShell.ps1 +++ b/Tests/syntax_test_PowerShell.ps1 @@ -92,6 +92,17 @@ throw "Do not run this file!" # ^^^ keyword.control # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted - constant - variable - comment +& gnutool.exe -s 'short option' --long-option --very_long_option value +plus-option +#<- keyword.operator.other +# ^^^^^^^^^^^ variable.function +# ^ variable.parameter.option punctuation.definition.parameter +# ^ variable.parameter.option +# ^^ variable.parameter.option punctuation.definition.parameter +# ^^ variable.parameter.option punctuation.definition.parameter +# ^^^^^^^^^^^^^^^^ variable.parameter.option +# ^ variable.parameter.option punctuation.definition.parameter +# ^^^^^^^^^^^ variable.parameter.option + # Automatic variables $_, $$, $^, $? # <- punctuation.definition.variable