Skip to content

Commit

Permalink
patch 8.1.2345: .cjs files are not recognized as Javascript
Browse files Browse the repository at this point in the history
Problem:    .cjs files are not recognized as Javascript.
Solution:   Add the *.cjs pattern. (closes #5268)
  • Loading branch information
brammool committed Nov 26, 2019
1 parent 6a228c6 commit c1faf3d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Nov 01
" Last Change: 2019 Nov 26

" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
Expand Down Expand Up @@ -800,8 +800,8 @@ au BufNewFile,BufRead *.java,*.jav setf java
" JavaCC
au BufNewFile,BufRead *.jj,*.jjt setf javacc

" JavaScript, ECMAScript
au BufNewFile,BufRead *.js,*.javascript,*.es,*.mjs setf javascript
" JavaScript, ECMAScript, ES module script, CommonJS script
au BufNewFile,BufRead *.js,*.javascript,*.es,*.mjs,*.cjs setf javascript

" JavaScript with React
au BufNewFile,BufRead *.jsx setf javascriptreact
Expand Down
2 changes: 1 addition & 1 deletion src/testdir/test_filetype.vim
Expand Up @@ -223,7 +223,7 @@ let s:filename_checks = {
\ 'jam': ['file.jpl', 'file.jpr'],
\ 'java': ['file.java', 'file.jav'],
\ 'javacc': ['file.jj', 'file.jjt'],
\ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.mjs'],
\ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs'],
\ 'javascriptreact': ['file.jsx'],
\ 'jess': ['file.clp'],
\ 'jgraph': ['file.jgr'],
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -737,6 +737,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2345,
/**/
2344,
/**/
Expand Down

0 comments on commit c1faf3d

Please sign in to comment.