-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Highlight <script> and <style> tags better. #88
Conversation
Use the javascript syntax for <script> & <script lang="javascript"> Use the css syntax for <style> & <sytle lang="css">
This is an essential PR for me, without it I end up with the same syntax highlighting as if I did |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <script>
and <style>
tags were actually intentionally left out, to let the html.vim
script do the highlighting of javascript and css. Can you attach a screenshot of the differences?
Also, are you using https://github.com/pangloss/vim-javascript or the default one shipped with vim?
unlet! b:current_syntax | ||
execute 'syntax region vue_' . a:language | ||
\ 'keepend' | ||
\ 'start=/<' . a:tag . '>/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lacks the \_[^>]*
from s:register_language()
, it's for maintaining the highlighting when the tag contains other, unrelated attributes.
However I think the s:register_language()
function can be reused to highlight <script>
and <style>
as well, since it's not that different. I can have a further look at this too when I find some time
@adriaanzon Here is a screenshot of the different modes I experience: https://i.imgur.com/S1r6sxF.png I am using https://github.com/jelera/vim-javascript-syntax but I get the same results using the default vim syntax highlighting. If I use So I think my issue is that my html syntax highlighting is no good for javascript. If I had to take a guess I would say that the reason this PR fixes it is that it explicitly registers the javascript syntax versus relying on html. |
what is the current status on this? is there a plan to merge at some point? |
is this dead? |
The current highlighting is fine for me, so I don't really want to hurt the loading time by sourcing |
Fixes #76.