diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index e53cdacbe3..c8942eb3d1 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -421,7 +421,6 @@ export def FThtml() setf htmlangular return endif - # Check for XHTML if getline(n) =~ '\' + setf superhtml + return + endif n += 1 endwhile setf FALLBACK html diff --git a/runtime/filetype.vim b/runtime/filetype.vim index d02826578e..bdf591ac7b 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1039,7 +1039,7 @@ au BufNewFile,BufRead *.t.html setf tilde " 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 diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index f8b3ea872b..3aa3e97f4e 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -1603,6 +1603,38 @@ func Test_html_file() call assert_equal('htmldjango', &filetype) bwipe! + " Super html layout + let content = ['', + \ '', + \ '', + \ '
', + \ '
'] + call writefile(content, 'Xfile.shtml', 'D') + split Xfile.shtml + call assert_equal('superhtml', &filetype) + bwipe! + + " Super html template + let content = ['', + \ '', + \ ' ', + \ ' ', + \ ' <super>', + \ ' suffix', + \ ' ', + \ ' ', + \ ' ', + \ ' ', + \ '
', + \ ' ', + \ '
', + \ ' ', + \ ''] + call writefile(content, 'Xfile.shtml', 'D') + split Xfile.shtml + call assert_equal('superhtml', &filetype) + bwipe! + " regular HTML let content = ['', '', ' Foobar', ' Content', ' ', ''] call writefile(content, 'Xfile.html', 'D') diff --git a/src/version.c b/src/version.c index 6520422955..a321cc53e3 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 635, /**/ 634, /**/