]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1957: filetype: bpftrace files are not recognized v9.1.1957
authorStanislaw Gruszka <stf_xl@wp.pl>
Sat, 6 Dec 2025 09:40:44 +0000 (10:40 +0100)
committerChristian Brabandt <cb@256bit.org>
Sat, 6 Dec 2025 09:40:44 +0000 (10:40 +0100)
Problem:  filetype: bpftrace files are not recognized
Solution: Detect *.bt files as btftrace filetype,
          include a btftrace filetype plugin (Stanislaw Gruszka)

closes: #18866

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/MAINTAINERS
runtime/autoload/dist/ft.vim
runtime/ftplugin/bpftrace.vim [new file with mode: 0644]
src/testdir/test_filetype.vim
src/version.c

index cdbf40a83364d9bad619fa94ab38cbda3b15e4cc..809664441c95c327573a5285ba59dfaad9f59446 100644 (file)
@@ -130,6 +130,7 @@ runtime/ftplugin/basic.vim                          @dkearns
 runtime/ftplugin/brighterscript.vim                    @ribru17
 runtime/ftplugin/brightscript.vim                      @ribru17
 runtime/ftplugin/bst.vim                               @tpope
+runtime/ftplugin/bpftrace.vim                          @sgruszka
 runtime/ftplugin/c3.vim                                        @ttytm
 runtime/ftplugin/cabal.vim                             @ribru17
 runtime/ftplugin/cedar.vim                             @ribru17
index 4312e6dca411e28e434f6ad12cfee30c64e39ca7..491521663a11bafe25a875e38ba2b0c856feb9b7 100644 (file)
@@ -1736,6 +1736,8 @@ const ft_from_ext = {
   # BSDL
   "bsd": "bsdl",
   "bsdl": "bsdl",
+  # Bpftrace
+  "bt": "bpftrace",
   # C3
   "c3": "c3",
   "c3i": "c3",
diff --git a/runtime/ftplugin/bpftrace.vim b/runtime/ftplugin/bpftrace.vim
new file mode 100644 (file)
index 0000000..b9ad1d1
--- /dev/null
@@ -0,0 +1,14 @@
+" Vim filetype plugin
+" Language:     bpftrace
+" Maintainer:  Stanislaw Gruszka <stf_xl@wp.pl>
+" Last Change: 2025 Dec 05
+
+if exists('b:did_ftplugin')
+  finish
+endif
+let b:did_ftplugin = 1
+
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
+setlocal commentstring=//\ %s
+
+let b:undo_ftplugin = "setlocal comments< commentstring<"
index 677c7419122088da3cf9a6b01de01a6fb689c492..6a6f5053bcffe46434f23a7b5852382126258e19 100644 (file)
@@ -148,6 +148,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     blank: ['file.bl'],
     blueprint: ['file.blp'],
     bp: ['Android.bp'],
+    bpftrace: ['file.bt'],
     brighterscript: ['file.bs'],
     brightscript: ['file.brs'],
     bsdl: ['file.bsd', 'file.bsdl'],
index 5c9f5c5c6c180d1eaae80d9ddc2dd1d8e80af833..ea874bc9b2f6460b024872ee75ef55723edcb31b 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1957,
 /**/
     1956,
 /**/