]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
This is the correct thing to do, vim-wise, although whether 990/head
authorTerry N. Brown <Brown.TerryN@epa.gov>
Mon, 6 May 2019 19:29:48 +0000 (15:29 -0400)
committerTerry N. Brown <Brown.TerryN@epa.gov>
Mon, 6 May 2019 19:29:48 +0000 (15:29 -0400)
it has any impact depends on how the user has folding set up
in vim. I confirmed that with the change, a folding setup that
uses these variables works, whereas without the change, the same
setup doesn't work.

Change only effects a file that has to be manually copied to the user's
~/.vim/syntax folder, so it won't impact jinja execution in any way.

ext/Vim/jinja.vim

index 2fd5838a501a113032e00eb9c9db48ac4e6ab18e..c81f594165d20f98eeb4fa14a75896372d9abbd7 100644 (file)
@@ -82,6 +82,9 @@ syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*end
 
 " Jinja comments
 syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
+" help support folding for some setups
+setlocal commentstring={#%s#}
+setlocal comments=s:{#,e:#}
 
 " Block start keywords.  A bit tricker.  We only highlight at the start of a
 " tag block and only if the name is not followed by a comma or equals sign