vim-vue
vim-vue copied to clipboard
Highlighting of paragraphs on multiple lines in pug
On all lines but the first one the first word in a multiline paragraph is highlighted in bold.
See line 4, 5 and 6 of the following screenshot:
I tried to reproduce it in a pure .pug file with no luck, so i figure it must be related to vim-vue.
Also having the same issue, any solutions?
This is because vim-vue has a rule to highlight any tag name, so that Vue component names are also highlighted.
https://github.com/posva/vim-vue/blob/e306929b27bea08ab505de7a4617e642b56b6dcd/syntax/vue.vim#L10-L11
I can see if I can disable this behavior for pug templates.
I think this can be solved by changing the lines mentioned above into this:
syntax match vueComponentName contained "\<[a-zA-Z0-9:-]*\>" containedin=htmlTagN
highlight default link vueComponentName htmlTagName
Instead of overriding htmlTagName
group, it creates a new group called vueComponentName
and gives it the same color as htmlTagName
.
Though i'm not so familiar with pug. Is it possible to include another Vue component inside a pug template? Because this will disable highlighting of all custom tag names inside pug templates.
p.
When I open a buffer and set the filetype to "pug",
and then when I begin the lines with html tag names like this
a foo bar
div foo bar
the html tag names get highlighted too.
So this may be a bug in vim-pug. Again, I'm not familiar with pug, so I don't know if the above example is valid pug code or not.