diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-10-23 19:30:44 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2023-10-24 10:15:47 +0200 |
commit | 4f0adb6a783e2d92301d5391c4b35a62268d2a00 (patch) | |
tree | ba8f34123f5199237a4f7eb7b9884dde3799f55a | |
parent | 94fee354465d7d8636f454a9bcca9080ef9e50bd (diff) | |
download | rneovim-4f0adb6a783e2d92301d5391c4b35a62268d2a00.tar.gz rneovim-4f0adb6a783e2d92301d5391c4b35a62268d2a00.tar.bz2 rneovim-4f0adb6a783e2d92301d5391c4b35a62268d2a00.zip |
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
https://github.com/vim/vim/commit/c038427d2a27445e612761f19c92b2b8b05afdea
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
-rw-r--r-- | runtime/lua/vim/filetype.lua | 1 | ||||
-rw-r--r-- | runtime/lua/vim/filetype/detect.lua | 3 | ||||
-rw-r--r-- | test/old/testdir/test_filetype.vim | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 763ed99914..3c3e2a7b5b 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -536,6 +536,7 @@ local extension = { jal = 'jal', jpr = 'jam', jpl = 'jam', + janet = 'janet', jav = 'java', java = 'java', jj = 'javacc', diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index 934b02dcdd..e53ff08536 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -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 diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 5cce0f0cc8..1c449aa93e 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -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. |