Skip to content

Commit 0a0217a

Browse files
committed
patch 8.0.0894: there is no test for runtime filetype detection
Problem: There is no test for runtime filetype detection. Solution: Test a list of filetypes from patterns.
1 parent 82b9ca0 commit 0a0217a

3 files changed

Lines changed: 482 additions & 3 deletions

File tree

runtime/filetype.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim support file to detect file types
22
"
33
" Maintainer: Bram Moolenaar <[email protected]>
4-
" Last Change: 2017 Jul 11
4+
" Last Change: 2017 Aug 09
55

66
" Listen very carefully, I will say this only once
77
if exists("did_load_filetypes")
@@ -1027,7 +1027,7 @@ au BufNewFile,BufRead *.java,*.jav setf java
10271027
au BufNewFile,BufRead *.jj,*.jjt setf javacc
10281028

10291029
" JavaScript, ECMAScript
1030-
au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript
1030+
au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx,*.mjs setf javascript
10311031

10321032
" Java Server Pages
10331033
au BufNewFile,BufRead *.jsp setf jsp
@@ -2267,6 +2267,8 @@ func! s:FTtex()
22672267
elseif format == 'plaintex'
22682268
let format = 'plain'
22692269
endif
2270+
elseif expand('%') =~ 'tex/context/.*/.*.tex'
2271+
let format = 'context'
22702272
else
22712273
" Default value, may be changed later:
22722274
let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain'
@@ -2308,7 +2310,7 @@ func! s:FTtex()
23082310
endfunc
23092311

23102312
" ConTeXt
2311-
au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv,*.mkvi setf context
2313+
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context
23122314

23132315
" Texinfo
23142316
au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo

0 commit comments

Comments
 (0)