asbjornenge / Docker.tmbundle

Dockerfile syntax
MIT License
75 stars 27 forks source link

Half of the coloring missing #33

Closed Seluj78 closed 2 years ago

Seluj78 commented 3 years ago

Hi! I was looking at this dockerfile and the color is incorrect for half the file

https://github.com/sickcodes/Docker-OSX/blob/8343da16fc3f2c5ebc6e1f79dbf53cdf3639d1f8/Dockerfile#L116-L198

cheers

rwbarton commented 3 years ago

It looks like the syntax highlighting thinks that the sequence \' can be used to quote a ' character in the middle of a single-quoted string, but this isn't actually true; this backslash is just a backslash. This occurs three times on lines 116, 117, 118, so from line 118 onward, the syntax highlighting has the insides and outsides of single-quoted strings swapped.

sickcodes commented 3 years ago

Here's the explanation if you're wondering why: https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html

echo '\'
\
echo $'\'
>
echo $"\"
>
echo "\"
>
princemaple commented 2 years ago

Hi, checkout the latest Dockerfile (with Bash) syntax

image

sickcodes commented 2 years ago

I also noticed Sublime text now offers Dockerfile (with Bash), so I assume the above is the same solution.

Perhaps allow or permit some type of LABEL syntax=bash vs. LABEL syntax=sh, if at all possible, or recognise SHELL ["/bin/bash", "-c"], if this helps.