diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-09 22:06:48 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-09 22:06:48 +0200 |
commit | 0a0217abfabcee8b0779df2e18a186a4b41e18ce (patch) | |
tree | d6ab4a6c46f95ba01d27271bc8ddcc0e9f04751a /runtime | |
parent | 82b9ca05f40a627355e7c3bcf49b1f19ffbdaf87 (diff) |
patch 8.0.0894: there is no test for runtime filetype detectionv8.0.0894
Problem: There is no test for runtime filetype detection.
Solution: Test a list of filetypes from patterns.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/filetype.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 39030aa2cd..df37ff7f59 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -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 |