vim-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: vim/vim#13400

c038427d2a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
Christian Clason 2023-10-23 19:30:44 +02:00
parent 94fee35446
commit 4f0adb6a78
3 changed files with 5 additions and 1 deletions

View File

@ -536,6 +536,7 @@ local extension = {
jal = 'jal',
jpr = 'jam',
jpl = 'jam',
janet = 'janet',
jav = 'java',
java = 'java',
jj = 'javacc',

View File

@ -1652,8 +1652,9 @@ local patterns_hashbang = {
['icon\\>'] = { 'icon', { vim_regex = true } },
guile = 'scheme',
['nix%-shell'] = 'nix',
['crystal\\>'] = { 'crystal', { vim_regex = true } },
['^crystal\\>'] = { 'crystal', { vim_regex = true } },
['^\\%(rexx\\|regina\\)\\>'] = { 'rexx', { vim_regex = true } },
['^janet\\>'] = { 'janet', { vim_regex = true } },
}
---@private

View File

@ -325,6 +325,7 @@ func s:GetFilenameChecks() abort
\ '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'],
@ -864,6 +865,7 @@ let s:script_checks = {
\ 'crystal': [['#!/path/crystal']],
\ 'rexx': [['#!/path/rexx'],
\ ['#!/path/regina']],
\ 'janet': [['#!/path/janet']],
\ }
" Various forms of "env" optional arguments.