Dear list,
I have some xml files containing JavaScript code inside a <javascript>
tag.
I would like Vim to highlight that code properly.

I looked at how the html syntax file solves a similar problem with the
<script> tag and found this:

syn include @htmlJavaScript syntax/javascript.vim
unlet b:current_syntax
syn region javaScript start=+<script[^>]*>+ keepend end=+</script>
+me=s-1
contai...@htmljavascript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc

So I came up with this:

syn include @xmlJavaScript syntax/javascript.vim
unlet b:current_syntax
syn region javaScript start=+<javascript>+ keepend end=+</javascript>
+me=s-1 contai...@xmljavascript

But it doesn't work. The Javascript code is not hightlighted.
If I try to debug the syntax highlighter with this command:

:for id in synstack(line('.'),col('.'))|echo synIDattr(id,'name')|
endfor

I only get a number of xmlRegion's and no javaScript region.
I tried to add contains=xmlJavaScript to the definition of xmlRegion,
but still no success.

Tobia
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/vim_use?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to