diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-23 23:25:01 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-23 23:25:01 +0200 |
commit | 7e2d060f880a2d1d8e4742e27709869425983335 (patch) | |
tree | bf64b510f26eaf046669dc0e94e5f263e154998e /autoload | |
parent | 3a298c975999f55a84fb40b9bb87be56b2a73953 (diff) | |
download | vim-polyglot-7e2d060f880a2d1d8e4742e27709869425983335.tar.gz vim-polyglot-7e2d060f880a2d1d8e4742e27709869425983335.zip |
Fix detecting jinja templates, #553
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/polyglot.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/autoload/polyglot.vim b/autoload/polyglot.vim index b7113f31..325287fc 100644 --- a/autoload/polyglot.vim +++ b/autoload/polyglot.vim @@ -370,6 +370,12 @@ func! polyglot#DetectHtmlFiletype() if line =~# '^\(%\|<[%&].*>\)' set ft=mason | return endif + for lnum in range(1, min([line("$"), 50])) + let line = getline(lnum) + if line =~# '{{.*}}\|{%-\=\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\(\<\|\>\)' + set ft=jinja.html | return + endif + endfor set ft=html | return endfunc |