LnL7 / vim-nix

Vim configuration files for Nix http://nixos.org/nix
MIT License
287 stars 26 forks source link

syntax: `$${}` is also an escape in simple-string contexts #46

Closed Ma27 closed 2 years ago

Ma27 commented 2 years ago

To demonstrate what I'm talking about:

$ nix repl
Welcome to Nix 2.7.0. Type :? for help.

nix-repl> a = "foo"

nix-repl> "${a}"
"foo"

nix-repl> "''${a}"
"''foo"

nix-repl> "$${a}"
"$${a}"

nix-repl> "\$${a}"
"$foo"

nix-repl> "\${a}"
"${a}"

This change ensures that each expression is highlighted properly in VIM. The primary issue was that $${...} was mistakenly highlighted as string interpolation.

cc @LnL7