Skip to content

Commit f281475

Browse files
sgruszkachrisbra
authored andcommitted
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_xl@wp.pl> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 86855ea commit f281475

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

runtime/autoload/dist/script.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vim9script
44
# Invoked from "scripts.vim" in 'runtimepath'
55
#
66
# Maintainer: The Vim Project <https://github.com/vim/vim>
7-
# Last Change: 2025 Aug 09
7+
# Last Change: 2025 Dec 22
88
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
99

1010
export def DetectFiletype()
@@ -233,6 +233,10 @@ export def Exe2filetype(name: string, line1: string): string
233233
elseif name =~ '^execlineb\>'
234234
return 'execline'
235235

236+
# Bpftrace
237+
elseif name =~ '^bpftrace\>'
238+
return 'bpftrace'
239+
236240
# Vim
237241
elseif name =~ '^vim\>'
238242
return 'vim'

src/testdir/test_filetype.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,7 @@ def s:GetScriptChecks(): dict<list<list<string>>>
10951095
['#!/path/regina']],
10961096
janet: [['#!/path/janet']],
10971097
dart: [['#!/path/dart']],
1098+
bpftrace: [['#!/path/bpftrace']],
10981099
vim: [['#!/path/vim']],
10991100
}
11001101
enddef

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
2007,
737739
/**/
738740
2006,
739741
/**/

0 commit comments

Comments
 (0)