Attached is a patch that fixes syntax highlighting for JavaScript
embedded within a JSP file.

syntax/jsp.vim was redefining the htmlTag highlight group, but the
original htmlTag group from syntax/html.vim was still defined.  It
took precedence, and as a result JavaScript code between <script> tags
went un-highlighted.

I also changed a syntax include statement to search for syntax/java.vim
in &rtp instead of assuming it's in the same directory as jsp.vim.

-- 
Erik Falor
Registered Linux User #445632 http://counter.li.org
*** .vim/syntax/jsp.vim	2010-08-06 12:24:49.758630800 -0600
--- devel/vim.hg/runtime/syntax/jsp.vim	2010-02-22 14:48:42.106209600 -0700
***************
*** 30,36 ****
  syn case match
  
  " Include Java syntax
! syn include @jspJava syntax/java.vim
  
  syn region jspScriptlet matchgroup=jspTag start=/<%/  keepend end=/%>/ contai...@jspjava
  syn region jspComment			  start=/<%--/	      end=/--%>/
--- 30,36 ----
  syn case match
  
  " Include Java syntax
! syn include @jspJava <sfile>:p:h/java.vim
  
  syn region jspScriptlet matchgroup=jspTag start=/<%/  keepend end=/%>/ contai...@jspjava
  syn region jspComment			  start=/<%--/	      end=/--%>/
***************
*** 48,55 ****
  syn keyword jspCommandArg contained width hspace vspace jreversion nspluginurl iepluginurl
  
  " Redefine htmlTag so that it can contain jspExpr
! syn clear htmlTag
! syn region htmlTag start=+<[^/%]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,jspExpr,javaScript
  
  " Define the default highlighting.
  " For version 5.7 and earlier: only when not done already
--- 48,54 ----
  syn keyword jspCommandArg contained width hspace vspace jreversion nspluginurl iepluginurl
  
  " Redefine htmlTag so that it can contain jspExpr
! syn region htmlTag start=+<[^/%]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,jspExpr
  
  " Define the default highlighting.
  " For version 5.7 and earlier: only when not done already

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui