Closed karlek closed 6 years ago
It looks like the fix is to add not
to fishConditional
here: https://github.com/dag/vim-fish/blob/825853f4816a07e59ea2ecee1190ab6a5d9ef991/syntax/fish.vim
No, you'd have to put it in fishLineContinuation
, which would mean it gets highlighted everywhere, as an argument to any command. Note that not
gets highlighted correctly if it's on its own; problem is if
works like sudo
and other such commands that wrap other commands. Thus, not
is technically just a string argument to if
and it's technically correct not to highlight it as anything other than a string argument. You could make a special syntax rule for if
but that gets hairy fast with Vim syntax rules, and tends to be slow. I decided against that for vim-fish.
The other way to do it is to drop fishLineContinuation
all-together and just make things like not
keywords. But then a line like echo if begin function end
highlights like a bunch of keywords, even though only echo
was anything other than a string argument. I decided it was more helpful to ensure that nothing is incorrectly highlighted as a keyword, than to ensure that anything that possibly ever could be a keyword always gets highlighted as such.
Good conclusion. It's better to not highlight keywords incorrectly.
dag/vim-fish
fish, version 2.4.0