patch 9.1.2007: filetype: bpftrace hashbang lines are not recognized
Commit:
https://github.com/vim/vim/commit/f2814754c0cd39875adcadffcb73206a83a46099
Author: Stanislaw Gruszka <
stf...@wp.pl>
Date: Mon Dec 22 18:17:36 2025 +0000
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: #18992
Signed-off-by: Stanislaw Gruszka <
stf...@wp.pl>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim
index 5fb45ccc5..de168f0c0 100644
--- a/runtime/autoload/dist/script.vim
+++ b/runtime/autoload/dist/script.vim
@@ -4,7 +4,7 @@ vim9script
# Invoked from "scripts.vim" in 'runtimepath'
#
# Maintainer: The Vim Project <
https://github.com/vim/vim>
-# Last Change: 2025 Aug 09
+# Last Change: 2025 Dec 22
# Former Maintainer: Bram Moolenaar <
Br...@vim.org>
export def DetectFiletype()
@@ -233,6 +233,10 @@ export def Exe2filetype(name: string, line1: string): string
elseif name =~ '^execlineb\>'
return 'execline'
+ # Bpftrace
+ elseif name =~ '^bpftrace\>'
+ return 'bpftrace'
+
# Vim
elseif name =~ '^vim\>'
return 'vim'
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 65f8bae32..6392f6996 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -1095,6 +1095,7 @@ def s:GetScriptChecks(): dict<list<list<string>>>
['#!/path/regina']],
janet: [['#!/path/janet']],
dart: [['#!/path/dart']],
+ bpftrace: [['#!/path/bpftrace']],
vim: [['#!/path/vim']],
}
enddef
diff --git a/src/version.c b/src/version.c
index 12dfb27af..ce81ba547 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2007,
/**/
2006,
/**/