diff options
author | Doug Kearns <dougkearns@gmail.com> | 2023-10-23 19:24:05 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-10-23 19:24:05 +0200 |
commit | c038427d2a27445e612761f19c92b2b8b05afdea (patch) | |
tree | 13a5fd47a162bc5ffd5c44e847aecc59f8a4238c | |
parent | ae9021a840db3253b0e0cb84186faae73368afd7 (diff) |
patch 9.0.2062: Janet files are not recognisedv9.0.2062
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>
-rw-r--r-- | runtime/autoload/dist/script.vim | 4 | ||||
-rw-r--r-- | runtime/filetype.vim | 3 | ||||
-rw-r--r-- | src/testdir/test_filetype.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 11 insertions, 0 deletions
diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim index fca5dcdbe6..fd7b8e08f8 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim @@ -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 '' diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 07d6bbfca1..aa66bead32 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -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 diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index f68ad00dd5..6b049afa9b 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -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 diff --git a/src/version.c b/src/version.c index a8de25a1f5..67f39f28f0 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2062, +/**/ 2061, /**/ 2060, |