Skip to content

Commit

Permalink
[PowerShell] Terminate here string at line start (leading white space…
Browse files Browse the repository at this point in the history
… not allowed).
  • Loading branch information
zufuliu committed Jun 26, 2024
1 parent 0dc184f commit 57436b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scintilla/lexers/LexPowerShell.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void ColourisePowerShellDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int
break;

case SCE_POWERSHELL_HERE_STRING_SQ:
if (sc.Match('\'', '@')) {
if (sc.atLineStart && sc.Match('\'', '@')) {
sc.Forward();
sc.ForwardSetState(SCE_POWERSHELL_DEFAULT);
}
Expand All @@ -144,7 +144,7 @@ void ColourisePowerShellDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int
sc.Forward();
} else if (sc.ch == '$') {
HighlightVariable(sc, nestedState);
} else if (sc.ch == '\"' && (sc.state != SCE_POWERSHELL_HERE_STRING_DQ || sc.chNext == '@')) {
} else if (sc.ch == '\"' && (sc.state != SCE_POWERSHELL_HERE_STRING_DQ || (sc.atLineStart && sc.chNext == '@'))) {
if (sc.state == SCE_POWERSHELL_HERE_STRING_DQ) {
sc.Forward();
}
Expand Down

0 comments on commit 57436b1

Please sign in to comment.