mirror of
https://github.com/vim/vim
synced 2025-07-15 16:51:57 +00:00
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:
committed by
Christian Brabandt
parent
ae9021a840
commit
c038427d2a
4
runtime/autoload/dist/script.vim
vendored
4
runtime/autoload/dist/script.vim
vendored
@ -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 ''
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2062,
|
||||
/**/
|
||||
2061,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user