sublimehq / Packages

Syntax highlighting files shipped with Sublime Text and Sublime Merge
https://sublimetext.com
Other
2.95k stars 587 forks source link

[ShellScript] nested parentheses treated as arithmetic #4033

Open keith-hall opened 3 weeks ago

keith-hall commented 3 weeks ago

What happened?

Currently $(( is treated as arithmetic even when it isn't. Example Bash snippet which finds modified txt files but doesn't return an exit code if grep finds no matches:

TXT_FILES=$((git diff --name-only --diff-filter=ACMR main | grep \.txt) || true)
if [[ -z "$TXT_FILES" ]]; then
    echo 'no text files modified'
fi

Adding a space after $( and before ( fixes the highlighting but shouldn't be necessary.