Skip to content

Commit 941fcc0

Browse files
StartAutomatingStartAutomating
authored andcommitted
Updating PSToken control (fixes #166)
1 parent 85dc335 commit 941fcc0

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

PipeScript.format.ps1xml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$token = $_
1919
$prevEnd = $_.PreviousToken.Start + $_.PreviousToken.Length
2020
$substring = $_.Text.Substring($prevEnd, $token.Start - $prevEnd)
21-
if ($substring) { $substring} else { ''}
21+
if ($substring) { $substring} else { '' }
2222
</ScriptBlock>
2323
</ExpressionBinding>
2424
<ExpressionBinding>
@@ -68,7 +68,7 @@
6868
<ExpressionBinding>
6969
<ItemSelectionCondition>
7070
<ScriptBlock>
71-
$_.Type -in 'Keyword', 'String'
71+
$_.Type -in 'Keyword', 'String', 'CommandArgument'
7272
</ScriptBlock>
7373
</ItemSelectionCondition>
7474
<PropertyName>Content</PropertyName>
@@ -85,15 +85,27 @@
8585
$_.Type -in 'Variable', 'Command'
8686
</ScriptBlock>
8787
</ItemSelectionCondition>
88-
<ScriptBlock>
89-
$_.Content
90-
</ScriptBlock>
88+
<PropertyName>Content</PropertyName>
9189
</ExpressionBinding>
9290
<ExpressionBinding>
9391
<ScriptBlock>@(&amp; ${PipeScript_Format-RichText} -ForegroundColor 'Warning' ) -join ''</ScriptBlock>
9492
</ExpressionBinding>
9593
<ExpressionBinding>
96-
<ScriptBlock>@(&amp; ${PipeScript_Format-RichText} -ForegroundColor 'Blue' -NoClear) -join ''</ScriptBlock>
94+
<ScriptBlock>@(&amp; ${PipeScript_Format-RichText} -ForegroundColor 'Magenta' -NoClear) -join ''</ScriptBlock>
95+
</ExpressionBinding>
96+
<ExpressionBinding>
97+
<ItemSelectionCondition>
98+
<ScriptBlock>
99+
$_.Type -in 'CommandParameter'
100+
</ScriptBlock>
101+
</ItemSelectionCondition>
102+
<PropertyName>Content</PropertyName>
103+
</ExpressionBinding>
104+
<ExpressionBinding>
105+
<ScriptBlock>@(&amp; ${PipeScript_Format-RichText} -ForegroundColor 'Magenta' ) -join ''</ScriptBlock>
106+
</ExpressionBinding>
107+
<ExpressionBinding>
108+
<ScriptBlock>@(&amp; ${PipeScript_Format-RichText} -ForegroundColor 'Magenta' -NoClear) -join ''</ScriptBlock>
97109
</ExpressionBinding>
98110
<ExpressionBinding>
99111
<ItemSelectionCondition>
@@ -104,12 +116,16 @@
104116
<PropertyName>Content</PropertyName>
105117
</ExpressionBinding>
106118
<ExpressionBinding>
107-
<ScriptBlock>@(&amp; ${PipeScript_Format-RichText} -ForegroundColor 'Blue' ) -join ''</ScriptBlock>
119+
<ScriptBlock>@(&amp; ${PipeScript_Format-RichText} -ForegroundColor 'Magenta' ) -join ''</ScriptBlock>
108120
</ExpressionBinding>
109121
<ExpressionBinding>
110122
<ItemSelectionCondition>
111123
<ScriptBlock>
112-
$_.Type -notin 'Comment', 'GroupStart', 'GroupEnd', 'Variable', 'Operator', 'Command','Keyword', 'String'
124+
$_.Type -notin 'Comment',
125+
'Keyword', 'String', 'CommandArgument',
126+
'Variable', 'Command',
127+
'CommandParameter',
128+
'Operator','GroupStart', 'GroupEnd'
113129
</ScriptBlock>
114130
</ItemSelectionCondition>
115131
<PropertyName>Content</PropertyName>

0 commit comments

Comments
 (0)