]> git.feebdaed.xyz Git - 0xmirror/vim.git/commitdiff
patch 9.1.2007: filetype: bpftrace hashbang lines are not recognized
authorStanislaw Gruszka <stf_xl@wp.pl>
Mon, 22 Dec 2025 18:17:36 +0000 (18:17 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 22 Dec 2025 18:17:36 +0000 (18:17 +0000)
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>
runtime/autoload/dist/script.vim
src/testdir/test_filetype.vim
src/version.c

index 5fb45ccc513885e500d1631db0435df81534d42f..de168f0c09e6407032e5fb14aae07ad732f29c16 100644 (file)
@@ -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 <Bram@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'
index 65f8bae3289a9c6749e1a8fb83fe7c435a88cd96..6392f6996eb59e3505198f2c3d2df4753443a47c 100644 (file)
@@ -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
index 12dfb27af9a3c4a8c2296514548093c994e8fe84..ce81ba547c5c64022cac22fb861c7ee04f823ab1 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2007,
 /**/
     2006,
 /**/