]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2062: Janet files are not recognised v9.0.2062
authorDoug Kearns <dougkearns@gmail.com>
Mon, 23 Oct 2023 17:24:05 +0000 (19:24 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 23 Oct 2023 17:24:05 +0000 (19:24 +0200)
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>
runtime/autoload/dist/script.vim
runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index fca5dcdbe618ecbba05a2566155a95d5d9fde333..fd7b8e08f8b366099ad476db52fcfa0a06e8b347 100644 (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 ''
index 07d6bbfca1d3d22c8bc98e47aba1da32bfe2ca69..aa66bead324af5e3048e9f55bed84ce48d24ebe3 100644 (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
 
index f68ad00dd5d0fe63fb46c69cc5079ac1c908af11..6b049afa9bfff288a2f620b837059a37ad537ac5 100644 (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
 
index a8de25a1f575e844c491eae8a0f2a6c3cdd5112b..67f39f28f0c1908629d1849b1cf2997100da2f14 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2062,
 /**/
     2061,
 /**/