jeff-hykin / better-shell-syntax

💾 📦 ♻️ An improvement to the shell syntax for VS Code
MIT License
52 stars 4 forks source link

[[ " $var " ]] breaks syntax highlighting #18

Closed ItamarShDev closed 1 year ago

ItamarShDev commented 3 years ago

image

varenc commented 2 years ago

I'm getting this too! Any space in any side of the `=~' condition breaks the syntax checking for the code below it. Here's a simpler example that breaks it more catastrophically:

[[ $T =~ "a string" ]] && echo "yes" || echo "no""
function testo() {  ### this loses highlighting due to the space in "a string" above
    ls -la
    pwd
}
image

removing the space in a string makes it work correctly.

jeff-hykin commented 1 year ago

should now be fixed! v1.2.5

varenc commented 1 year ago

thank you!! though another issue: the latest version, v1.2.9, now seems to cause syntax highlighting breakage on this code:

1="`mpp`"

All the function after that don't get blue names and other highlighting breaks.

Of course re-assigning the $1 var is bad practice so I don't mind too much this reminder to fix that. Was confusing that this new issue popped up but this note made me realize I'd been auto-updated. Downgrading to v1.1.0 fixed it.