1
0
Fork 0

nasal.vim: add <?...?> and <!--...--> to XML embedded mode

and only enable that if the file extension is xml
This commit is contained in:
mfranz 2008-08-13 10:21:42 +00:00
parent 0d0bd58268
commit 226231434e

View file

@ -26,8 +26,8 @@ endif
syn keyword nasalCommentTodo TODO FIXME XXX contained syn keyword nasalCommentTodo TODO FIXME XXX contained
syn match nasalComment "#.*$" contains=nasalCommentTodo syn match nasalComment "#.*$" contains=nasalCommentTodo
syn region nasalStringS start=+'+ skip=+\\'+ end=+'+ contains=nasalSpecialS syn region nasalStringS start=+'+ skip=+\\'+ end=+'+ contains=nasalSpecialS
syn region nasalStringD start=+"+ skip=+\\"+ end=+"+ contains=nasalSpecialD,nasalSpecial syn region nasalStringD start=+"+ skip=+\\"+ end=+"+ contains=nasalSpecialD,nasalSpecial
syn match nasalSpecialS contained "\\'" syn match nasalSpecialS contained "\\'"
syn match nasalSpecialD contained "\\[\\rnt\"]" syn match nasalSpecialD contained "\\[\\rnt\"]"
syn match nasalSpecial contained "\\x[[:xdigit:]][[:xdigit:]]" syn match nasalSpecial contained "\\x[[:xdigit:]][[:xdigit:]]"
@ -86,10 +86,14 @@ if !exists("nasal_no_fgfs")
syn keyword nasalPropsFunction getPath getBoolValue setValues getValues syn keyword nasalPropsFunction getPath getBoolValue setValues getValues
syn match nasalPropsFunction "\<props\.\(_\?globals\|Node\|nodeList\|initNode\|condition\)\>\.\=" syn match nasalPropsFunction "\<props\.\(_\?globals\|Node\|nodeList\|initNode\|condition\)\>\.\="
" mark obvious XML parts as comments (for editing XML embedded nasal) " XML embedded mode
syn match nasalComment "^\s*</\?[[:alnum:]!].*[[:alnum:]\"-]/\?>\s*$" if expand("%:e") == "xml"
syn match nasalComment "^\s*<!\[CDATA\[\s*$" syn region nasalComment start="<!--" end="-->" contains=nasalCommentTodo
syn match nasalComment "^\s*\]\]>\s*$" syn region nasalComment start="<?" end="?>" contains=nasalCommentTodo
syn match nasalComment "^\s*</\?[[:alnum:]!].*[[:alnum:]\"-]/\?>\s*$"
syn match nasalComment "^\s*<!\[CDATA\[\s*$"
syn match nasalComment "^\s*\]\]>\s*$"
endif
endif endif