patch 9.0.2062: Janet files are not recognised

Problem:  Janet files are not recognised
Solution: Add filename and shebang detection (without
          adding an extra filetype plugin)

Those are used by the Janet language:
http://www.janet-lang.org

closes: #13400

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
Doug Kearns
2023-10-23 19:24:05 +02:00
committed by Christian Brabandt
parent ae9021a840
commit c038427d2a
4 changed files with 11 additions and 0 deletions

View File

@ -217,6 +217,10 @@ export def Exe2filetype(name: string, line1: string): string
elseif name =~ '^\%(rexx\|regina\)\>'
return 'rexx'
# Janet
elseif name =~ '^janet\>'
return 'janet'
endif
return ''

View File

@ -1034,6 +1034,9 @@ au BufNewFile,BufRead *.jal,*.JAL setf jal
" Jam
au BufNewFile,BufRead *.jpl,*.jpr setf jam
" Janet
au BufNewFile,BufRead *.janet setf janet
" Java
au BufNewFile,BufRead *.java,*.jav setf java

View File

@ -335,6 +335,7 @@ def s:GetFilenameChecks(): dict<list<string>>
j: ['file.ijs'],
jal: ['file.jal', 'file.JAL'],
jam: ['file.jpl', 'file.jpr', 'JAM-file.file', 'JAM.file', 'Prl-file.file', 'Prl.file'],
janet: ['file.janet'],
java: ['file.java', 'file.jav'],
javacc: ['file.jj', 'file.jjt'],
javascript: ['file.js', 'file.jsm', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs'],
@ -953,6 +954,7 @@ def s:GetScriptChecks(): dict<list<list<string>>>
crystal: [['#!/path/crystal']],
rexx: [['#!/path/rexx'],
['#!/path/regina']],
janet: [['#!/path/janet']],
}
enddef

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2062,
/**/
2061,
/**/