Closed amerov closed 5 years ago
Hi, as vueScript
is a basic syntax for all wrapped in <script>
, it should be related to the syntax of javascript.
Could you test number syntax in a normal javascript
file? And what javascript syntax plugin do you use?
Here is my syntax highlighting:
default javascript syntax:
with 'pangloss/vim-javascript' enabled:
Hi, as
vueScript
is a basic syntax for all wrapped in<script>
, it should be related to the syntax of javascript. Could you test number syntax in a normaljavascript
file? And what javascript syntax plugin do you use? Here is my syntax highlighting:default javascript syntax:
with 'pangloss/vim-javascript' enabled:
Normal js syntax is okay. I use 'pangloss/vim-javascript' My vimrc: https://github.com/amerov/dotfiles/blob/master/.config/nvim/init.vim
Thank you for sharing your vimrc. I need more info to debug. There is a SynStack
function in it. Could you move the cursor to -10
's -
and 10
and
:call SynStack()
It will display all syntax applied to them. For the latest vim-javascript
(It has been updated recently), there should be jsOperator
for -
and jsNumber
for 10
.
And try
:verb hi jsOperator
:verb hi jsNumber
to show detail info.
synStack result for 10
: ['vueScript', 'jsObject', 'jsFuncBlock']
synStack result for -
: ['vueScript', 'jsObject', 'jsFuncBlock', 'jsOperator']
:verb hi jsNumber
jsNumber xxx links to Number
Last set from ~/.local/share/nvim/plugged/vim-javascript/syntax/javascript.vim
:verb hi jsOperator
jsOperator xxx links to Operator
Last set from ~/.local/share/nvim/plugged/vim-javascript/syntax/javascript.vim
when let g:vim_vue_plugin_load_full_syntax=0
number with minus highlighting is ok. But html's data attributes isn't.
Thank you for the feedback. I use gVim and will try Neovim to see what happens.
Yes. let g:vim_vue_plugin_load_full_syntax=1
and using othree/html5.vim
reproduce this error.
othree/html5.vim
uses syn iskeyword
(see :h syn-iskeyword
) that adds -
to iskeyword option, causing -10
highlighting error. I have replaced -
with $
for vue
.
Now html's data attributes broken.
I didn't consider the impact on HTML attributes(for which -
is required in syntax keyword). Then I adjusted the javascript number highlighting pattern so both are satisfied now.
Thanks! Now current state is ok. Also I open issue for html5 plugin https://github.com/othree/html5.vim/issues/103
-10
recognized as avueScript