From 4f0adb6a783e2d92301d5391c4b35a62268d2a00 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 23 Oct 2023 19:30:44 +0200 Subject: 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 --- runtime/lua/vim/filetype.lua | 1 + runtime/lua/vim/filetype/detect.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim') 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 -- cgit