jschaf / powershell.el

An Emacs mode for editing and running Microsoft PowerShell code.
93 stars 30 forks source link

False positive match for here-string #26

Open glucas opened 5 years ago

glucas commented 5 years ago

I have a powershell script with this line (part of a loop looking for @xxx@ tokens in a file.

            $key = '@' + $_.Key + '@'

This is being interpreted as starting a here-string so everything after that in the file has the wrong syntax highlighting.

glucas commented 5 years ago

Workaround is to add a comment char or whitespace at the end of the line. The issue appears to be having a line ending with @'$.

audreytoskin commented 5 years ago

I've also noticed this issue, even when the at sign is backtick-escaped. Something like

Write-Host "`@"

will continue syntax highlighting for a string until the next quotation mark, even though that's actually the beginning of a different string.