Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not keyword is not highlighted #39

Closed
karlek opened this issue Jan 11, 2017 · 4 comments
Closed

Not keyword is not highlighted #39

karlek opened this issue Jan 11, 2017 · 4 comments

Comments

@karlek
Copy link

karlek commented Jan 11, 2017

dag/vim-fish
out5958

fish, version 2.4.0
out9659

@karlek
Copy link
Author

karlek commented Jan 11, 2017

It looks like the fix is to add not to fishConditional here: https://github.com/dag/vim-fish/blob/825853f4816a07e59ea2ecee1190ab6a5d9ef991/syntax/fish.vim

@dag
Copy link
Owner

dag commented Nov 22, 2017

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.

@dag dag closed this as completed Nov 22, 2017
@dag
Copy link
Owner

dag commented Nov 22, 2017

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.

@karlek
Copy link
Author

karlek commented Nov 22, 2017

Good conclusion. It's better to not highlight keywords incorrectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants