diff options
-rw-r--r-- | runtime/lua/vim/filetype/detect.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index fa90c83b81..997b53ba4b 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -676,10 +676,15 @@ end --- @type vim.filetype.mapfn function M.html(_, bufnr) - for _, line in ipairs(getlines(bufnr, 1, 10)) do + for _, line in ipairs(getlines(bufnr, 1, 40)) do if matchregex(line, [[\<DTD\s\+XHTML\s]]) then return 'xhtml' - elseif matchregex(line, [[\c{%\s*\(extends\|block\|load\)\>\|{#\s\+]]) then + elseif + matchregex( + line, + [[\c{%\s*\(autoescape\|block\|comment\|csrf_token\|cycle\|debug\|extends\|filter\|firstof\|for\|if\|ifchanged\|include\|load\|lorem\|now\|query_string\|regroup\|resetcycle\|spaceless\|templatetag\|url\|verbatim\|widthratio\|with\)\>\|{#\s\+]] + ) + then return 'htmldjango' end end |