1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2017-08-09 22:06:48 +02:00
parent 82b9ca05f4
commit 0a0217abfa
3 changed files with 482 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Jul 11
" Last Change: 2017 Aug 09
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -1027,7 +1027,7 @@ au BufNewFile,BufRead *.java,*.jav setf java
au BufNewFile,BufRead *.jj,*.jjt setf javacc
" JavaScript, ECMAScript
au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript
au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx,*.mjs setf javascript
" Java Server Pages
au BufNewFile,BufRead *.jsp setf jsp
@@ -2267,6 +2267,8 @@ func! s:FTtex()
elseif format == 'plaintex'
let format = 'plain'
endif
elseif expand('%') =~ 'tex/context/.*/.*.tex'
let format = 'context'
else
" Default value, may be changed later:
let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain'
@@ -2308,7 +2310,7 @@ func! s:FTtex()
endfunc
" ConTeXt
au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv,*.mkvi setf context
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context
" Texinfo
au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo