summaryrefslogtreecommitdiffstats
path: root/autoload
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-09-23 23:25:01 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-09-23 23:25:01 +0200
commit7e2d060f880a2d1d8e4742e27709869425983335 (patch)
treebf64b510f26eaf046669dc0e94e5f263e154998e /autoload
parent3a298c975999f55a84fb40b9bb87be56b2a73953 (diff)
downloadvim-polyglot-7e2d060f880a2d1d8e4742e27709869425983335.tar.gz
vim-polyglot-7e2d060f880a2d1d8e4742e27709869425983335.zip
Fix detecting jinja templates, #553
Diffstat (limited to 'autoload')
-rw-r--r--autoload/polyglot.vim6
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