nix-mode
nix-mode copied to clipboard
* inside '' strings breaks syntax highlighting
Minimal example (not broken here on GH):
{
foo = "woot/*";
bar = ''
woot/*
'';
baz = "hello";
}
In latest nix-mode you will see that highlighting is broken from bar
onwards due to the *
inside the ''
being interpreted wrongly.
I am not having this issue. What Emacs version are you running? I am testing on Emacs 25.2. Also whether you have MMM installed might be a factor.
I do have mmm-mode installed which is being pulled in by markdown (spacemacs):
https://gist.github.com/27029c8a53132f0cdb37d4c920b29f30
And this is on 25.2
What I'm seeing is that syntax highlighting doesn't treat the contents of indented strings as strings (with two single quote characters as delimiters, not double quotes).
It doesn't appear to be connected to /*
; that's just the most obvious symptom (since it highlights the rest of the file as a single comment). In this example:
With this example:
{
foo = "12";
bar = ''some stuff inherit with /*'';
baz = let x = 12; in x;
}
I see:
-
some stuff
in black, like ordinary code, not like the string"12"
-
inherit
andwith
highlighted as keywords - everything from
/*
onwards highlighted as a comment
I'm on the latest nixos-unstable; everything's from the channel. Emacs is version 25.3.1. I don't have MMM installed as far as I know.
If you run nixos then nix-mode distributed as part of nix gets loaded instead of custom one. You can fix that by removing standard load path in your Emacs config.