Closed ap closed 5 years ago
@Fandekasp: If you move the cursor into a string that should be highlighted but isn’t and issue the following command, what does it say?
:echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
@ap thanks for the quick follow-up :heart:
Line not highlighted:
teal: "#00aed7", //{
['javascriptObjectLiteral', 'javascriptObjectLiteral', 'javascriptObjectLiteral', 'javascriptString']
Line highlighted:
//100: "#e6fffa",
['javascriptObjectLiteral', 'javascriptObjectLiteral', 'javascriptObjectLiteral', 'javascriptLineComment', 'BGe6fffa']
The JS(X) syntax plugin you are using is not yet supported, only the Vim stock Javascript syntax and and pangloss/vim-javascript.
You get colours in comments anyway because group names are not case sensitive and the Vim stock Javascript syntax uses javaScriptLineComment
– which happens to match javascriptLineComment
case insensitively.
But the stock syntax has only javaScriptStringS
and javaScriptStringD
and nothing that would match javascriptString
, so that case goes uncovered.
(And pangloss’ syntax uses js
as its group name prefix, so it doesn‘t come up here at all.)
What plugin are you using?
@ap I see. Here are the plugins I use for js.
Plug 'othree/yajs.vim', { 'for': 'javascript' }
Plug 'mxw/vim-jsx', { 'for': 'javascript' }
There you go. Share and enjoy 🙂
Whoops.
Many thanks @ap!
Originally posted by @Fandekasp in https://github.com/ap/vim-css-color/issues/89#issuecomment-500723793