patch 9.1.0635: filetype: SuperHTML template files not recognized
Problem: filetype: SuperHTML template files not recognized
Solution: Update the filetype detection code to detect '*.shtml' either
as HTML (Server Side Includes) or SuperHTML (template files)
(EliSauder)
related: #15355
related: #15367
Signed-off-by: EliSauder <24995216+EliSauder@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index e53cdac..c8942eb 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -421,7 +421,6 @@
setf htmlangular
return
endif
-
# Check for XHTML
if getline(n) =~ '\<DTD\s\+XHTML\s'
setf xhtml
@@ -432,6 +431,11 @@
setf htmldjango
return
endif
+ # Check for SuperHTML
+ if getline(n) =~ '<extend\|<super>'
+ setf superhtml
+ return
+ endif
n += 1
endwhile
setf FALLBACK html
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index d028265..bdf591a 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1039,7 +1039,7 @@
" Translate shell
au BufNewFile,BufRead init.trans,*/etc/translate-shell,.trans setf clojure
-" HTML (.shtml and .stm for server side)
+" HTML (.stm for server side, .shtml is server-side or superhtml)
au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call dist#ft#FThtml()
au BufNewFile,BufRead *.cshtml setf html