Permalink
Browse files

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.
  • Loading branch information...
brammool committed Aug 9, 2017
1 parent 82b9ca0 commit 0a0217abfabcee8b0779df2e18a186a4b41e18ce
Showing with 482 additions and 3 deletions.
  1. +5 −3 runtime/filetype.vim
  2. +475 −0 src/testdir/test_filetype.vim
  3. +2 −0 src/version.c
View
@@ -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
Oops, something went wrong.

0 comments on commit 0a0217a

Please sign in to comment.