Skip to content

When used with javascript-libraries-syntax, all the "ng-*" html attribute cannot be properly highlighted. #704

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

Closed
xc1427 opened this issue Nov 10, 2016 · 2 comments

Comments

@xc1427
Copy link

xc1427 commented Nov 10, 2016

Environment: Windows 10 64bit, gvim8.0 64bit.

Here is the syntax highlighting:

image

The problem comes from vim-javascript/syntax/javascript.vim @ line 17

syntax iskeyword @,48-57,_,192-255,$

When reading html file, gvim also loads javascript.vim syntax file (I also want to know how this is done if someone can kindly teach me :) )

As syntax iskeyword does not include hyphen -, all html attributes which contain hyphen cannot be recognized as htmlArg but as htmlTag (This script can identify syntax highlighting).

My workaround is to add to _vimrc:

autocmd FileType html syntax iskeyword @,48-57,_,192-255,$,-

Then highlighting is correct:

image

But I think it is better to be done cleanly in vim-javascript plugin.

@bounceme
Copy link
Collaborator

the hyphen isn't a keyword character in js though.

#153

@bounceme
Copy link
Collaborator

Essentially, there is an issue with the html script which this repo can't fix, it being for javascript files.

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