]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Don't use setlocal in syntax file (#1164)
authorKen Crowell <oeuftete@gmail.com>
Sun, 12 Apr 2020 16:46:08 +0000 (13:46 -0300)
committerGitHub <noreply@github.com>
Sun, 12 Apr 2020 16:46:08 +0000 (09:46 -0700)
I'm not 100% sure that one should not use `setlocal` in a syntax file,
but this breaks other filetypes that may include this syntax file, like
the vim-markdown plugin.  The `comments` and `commentstring` get set for
that markdown buffer with the jinja settings.

See
https://github.com/dhruvasagar/vim-table-mode/issues/162#issuecomment-595317626
for an example of side effects.

ext/Vim/jinja.vim

index e2a5bbf6c9abce10da0823e4541956117cff7b45..63f0d99a87d93a1c6552a52a66d365a79c452bd7 100644 (file)
@@ -82,9 +82,6 @@ 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