commit 92910a8ab875fee218a7acc4e2a2f90811ce288e
parent a979a6237e6367373e88ab204bfa0f8c4725285a
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue, 23 Dec 2025 06:53:33 +0800
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 <stf_xl@wp.pl>
Diffstat:
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git 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
@@ -1089,6 +1089,7 @@ func s:GetScriptChecks() abort
\ ['#!/path/regina']],
\ 'janet': [['#!/path/janet']],
\ 'dart': [['#!/path/dart']],
+ \ 'bpftrace': [['#!/path/bpftrace']],
\ 'vim': [['#!/path/vim']],
\ }
endfunc