From 92910a8ab875fee218a7acc4e2a2f90811ce288e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 23 Dec 2025 06:53:33 +0800 Subject: [PATCH] vim-patch:9.1.2007: filetype: bpftrace hashbang lines are not recognized Problem: bpftrace files are not recognized from the hashbang line. Solution: Add a hashbang check (Stanislaw Gruszka) closes: vim/vim#18992 https://github.com/vim/vim/commit/f2814754c0cd39875adcadffcb73206a83a46099 Co-authored-by: Stanislaw Gruszka --- runtime/lua/vim/filetype/detect.lua | 1 + test/old/testdir/test_filetype.vim | 1 + 2 files changed, 2 insertions(+) diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index aabb0361ad..a58b7b485f 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -2040,6 +2040,7 @@ local patterns_hashbang = { ['^janet\\>'] = { 'janet', { vim_regex = true } }, ['^dart\\>'] = { 'dart', { vim_regex = true } }, ['^execlineb\\>'] = { 'execline', { vim_regex = true } }, + ['^bpftrace\\>'] = { 'bpftrace', { vim_regex = true } }, ['^vim\\>'] = { 'vim', { vim_regex = true } }, } diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 0ad9973cec..a7772c430d 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -1089,6 +1089,7 @@ func s:GetScriptChecks() abort \ ['#!/path/regina']], \ 'janet': [['#!/path/janet']], \ 'dart': [['#!/path/dart']], + \ 'bpftrace': [['#!/path/bpftrace']], \ 'vim': [['#!/path/vim']], \ } endfunc