Fix tag recognition when starting/ending with -

As can be found on
https://www.webforefront.com/django/usebuiltinjinjastatements.html
jinja tags can actually start and end with a `-` after resp. before the
`%` sign. This has been added to the regex.
This commit is contained in:
Thyrum
2021-07-17 17:42:25 +02:00
parent 8d330a7aaf
commit 3a953da16c

View File

@@ -1,7 +1,7 @@
" Vim indent file " Vim indent file
" Language: Jinja HTML template " Language: Jinja HTML template
" Maintainer: Evan Hammer <evan@evanhammer.com> " Maintainer: Evan Hammer <evan@evanhammer.com>
" Last Change: 2013 Jan 26 " Last Change: 2021 Jul 17
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")
@@ -50,8 +50,8 @@ function! GetDjangoIndent(...)
let pnb = getline(lnum) let pnb = getline(lnum)
let cur = getline(v:lnum) let cur = getline(v:lnum)
let tagstart = '.*' . '{%\s*' let tagstart = '.*' . '{%-\?\s*'
let tagend = '.*%}' . '.*' let tagend = '.*-\?%}' . '.*'
let blocktags = '\(block\|for\|if\|with\|autoescape\|comment\|filter\|spaceless\)' let blocktags = '\(block\|for\|if\|with\|autoescape\|comment\|filter\|spaceless\)'
let midtags = '\(empty\|else\|elif\)' let midtags = '\(empty\|else\|elif\)'