LnL7 / vim-nix

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

Interpolation escaping #11

Closed nicknovitski closed 7 years ago

nicknovitski commented 7 years ago

While working on a nix expression containing a multi-line string which contains a bash script which outputs a nix expression which contains single-line strings which have interpolations (phew!), I noticed that interpolations are always highlighted, even when they've been escaped.

{
  singleline = "${shouldBeHighlighted}\${shouldNotBe}";
  multiline = ''
    ${shouldBeHighlighted}
    ''${shouldNotBe}
  '';
}
LnL7 commented 7 years ago

Either I'm not understanding the issue correctly or the plugin is not getting loaded correctly (I've had this issue with vim_configurable before). The example looks fine good to me.

screen shot 2017-04-03 at 20 33 41
nicknovitski commented 7 years ago

Hmmmm! That is quite unsettling. I am using vim_configurable. I'll look into the problem.

Thanks for your efforts. :)

nicknovitski commented 7 years ago

Wow, you're totally right, I've been working with fake syntax highlighting this whole time.

It's very strange: my installations of elm-vim and rust.vim are not subject to the same problem, but I can't figure out what's different about them.

LnL7 commented 7 years ago

vim_configurable includes some minimal syntax highlighting for nix by default. That seems to cause conflicts in some cases, but I'm still not sure when this happens.

nicknovitski commented 7 years ago

Wooooah so it applies this patch before loading any other plugins? That sure seems like it could cause a conflict.

And indeed, if I set vim.ftNix = false; in my ~/.nixpkgs/config.nix, then recompile vim without that "patch," then I actually get to see your plugin! Good grief! It's perfect!