davidcelis / language-fish-shell

:fish: Atom snippets and syntax highlighting for Fish, the friendly interactive shell.
MIT License
12 stars 4 forks source link

Incorrect handling of escaped characters #8

Closed RSully closed 6 years ago

RSully commented 8 years ago

Something like this breaks the highlighting:

set -l datafile (eval echo \"$data\")

screen shot 2016-07-03 at 19 06 03

ghost commented 8 years ago

Yes, so in the meantime, do

set -l datafile (eval echo "\"$data\"")

NOTE: Another example removed because it doesn't work.

RSully commented 8 years ago

I originally tried your second example, but it has different functionality, so it is no good. Your first example does work though:

> set data '$var/thing'
> eval echo \"$data\"
/thing
> eval echo '"$data"'
$var/thing
> eval echo "\"$data\""
/thing

However, obviously I am not going to change my code just for syntax highlighting ;). I'll take a look at the source here and see how difficult it may be to fix.

Also, it appears whatever syntax highlighter GitHub uses for fish also has this same problem. I'm guessing they're both based on the same codebase.

ghost commented 8 years ago

You are right, the second example is bad.

I'm guessing they're both based on the same codebase.

Yeah, I think so too.