Skip to content

Commit

Permalink
vim-patch:8.0.0894: there is no test for runtime filetype detection
Browse files Browse the repository at this point in the history
Problem:    There is no test for runtime filetype detection.
Solution:   Test a list of filetypes from patterns.

vim/vim@0a0217a
  • Loading branch information
justinmk committed Feb 11, 2018
1 parent 16a4168 commit 9baf60c
Show file tree
Hide file tree
Showing 2 changed files with 479 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,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
Expand Down Expand Up @@ -2265,6 +2265,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'
Expand Down Expand Up @@ -2306,7 +2308,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
Expand Down
Loading

0 comments on commit 9baf60c

Please sign in to comment.