better-shell-syntax icon indicating copy to clipboard operation
better-shell-syntax copied to clipboard

Parameter substitutions in general are coloured incorrectly

Open cD1rtX3 opened this issue 2 weeks ago • 3 comments

The code with a problem is:

echo "${1:-Nothing}"

It looks like:

Image

It should look like:

The Nothing is a string and should be brown.

cD1rtX3 avatar Nov 22 '25 17:11 cD1rtX3

This is misleading to someone just learning about parameter substitutions, because it makes it look like Nothing will be subbed as a variable, when it's actually a string.

cD1rtX3 avatar Nov 22 '25 17:11 cD1rtX3

This code:

printf %s\\n "${1-$(date -u +'%-H:%M on %-d %B %+4Y')}"
Image

prints either the first argument or the current time and date, and works correctly, but isn't highlighted correctly.

cD1rtX3 avatar Nov 22 '25 17:11 cD1rtX3

bruh
Image

cD1rtX3 avatar Nov 22 '25 17:11 cD1rtX3