diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2018-12-26 10:41:57 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2018-12-26 10:41:57 +0100 |
commit | d43b70d93987c94d15a352cf0026fb93d3317cc8 (patch) | |
tree | 74470b6cc30ddb4ef8ceb2ec557bc32ccccb5ebb /syntax/mustache.vim | |
parent | ec1c94306953b678bb36572897bd218fe6c76506 (diff) | |
download | vim-polyglot-d43b70d93987c94d15a352cf0026fb93d3317cc8.tar.gz vim-polyglot-d43b70d93987c94d15a352cf0026fb93d3317cc8.zip |
Update
Diffstat (limited to 'syntax/mustache.vim')
-rw-r--r-- | syntax/mustache.vim | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/syntax/mustache.vim b/syntax/mustache.vim index 89cb59b3..50babe83 100644 --- a/syntax/mustache.vim +++ b/syntax/mustache.vim @@ -4,8 +4,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == " Language: Mustache, Handlebars " Maintainer: Juvenn Woo <machese@gmail.com> " Screenshot: http://imgur.com/6F408 -" Version: 2 -" Last Change: Oct 26th 2013 +" Version: 5 +" Last Change: Nov 23rd 2018 " Remark: " It lexically hilights embedded mustaches (exclusively) in html file. " While it was written for Ruby-based Mustache template system, it should @@ -43,15 +43,17 @@ endif syntax match mustacheError '}}}\?' syntax match mustacheInsideError '{{[{$#<>=!\/]\?' -syntax region mustacheInside start=/{{[^!]/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer -syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,@htmlMustacheContainer -syntax region mustacheSection start='{{[$#^/]'lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer +syntax region mustacheInside start=/{{[^!][$#^/]\?/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer +syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,mustacheParam,@htmlMustacheContainer +syntax region mustacheHtmlValue start=/={{[^!][$#^/]\?/rs=s+1,hs=s+1 end=/}}/ oneline keepend contained containedin=htmlTag contains=mustacheInside syntax region mustachePartial start=/{{[<>]/lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer syntax region mustacheMarkerSet start=/{{=/lc=2 end=/=}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer -syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside -syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection +syntax match mustacheConditionals '\([/#]\?if\|unless\|else\)' contained containedin=mustacheInside +syntax match mustacheHelpers '[/#]\?\(with\|link\-to\|each\(\-in\)\?\)' contained containedin=mustacheInside +syntax match mustacheHelpers 'else \(if\|unless\|with\|link\-to\|each\(\-in\)\?\)' contained containedin=mustacheInside +syntax match mustacheParam /[a-z@_-]\+=/he=e-1 contained containedin=mustacheInside syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=TOP,mustacheInside,@htmlMustacheContainer syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=TOP,mustacheInside,@htmlMustacheContainer syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside @@ -67,8 +69,8 @@ syntax cluster htmlMustacheContainer add=htmlHead,htmlTitle,htmlString,htmlH1,ht HtmlHiLink mustacheVariable Number HtmlHiLink mustacheVariableUnescape Number HtmlHiLink mustachePartial Number -HtmlHiLink mustacheSection Number HtmlHiLink mustacheMarkerSet Number +HtmlHiLink mustacheParam htmlArg HtmlHiLink mustacheComment Comment HtmlHiLink mustacheBlockComment Comment |