summaryrefslogtreecommitdiff
path: root/runtime/filetype.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-09 22:06:48 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-09 22:06:48 +0200
commit0a0217abfabcee8b0779df2e18a186a4b41e18ce (patch)
treed6ab4a6c46f95ba01d27271bc8ddcc0e9f04751a /runtime/filetype.vim
parent82b9ca05f40a627355e7c3bcf49b1f19ffbdaf87 (diff)
downloadvim-git-0a0217abfabcee8b0779df2e18a186a4b41e18ce.tar.gz
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/filetype.vim')
-rw-r--r--runtime/filetype.vim8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 39030aa2c..df37ff7f5 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