mirror of
https://github.com/lepture/vim-jinja.git
synced 2025-11-12 13:23:50 -05:00
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:
@@ -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\)'
|
||||||
|
|||||||
Reference in New Issue
Block a user