]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0302: filetype: blueprint files are not recognized v9.1.0302
authorBruno BELANYI <bruno@belanyi.fr>
Wed, 10 Apr 2024 20:28:28 +0000 (22:28 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 10 Apr 2024 20:28:28 +0000 (22:28 +0200)
Problem:  filetype: blueprint files are not recognized
Solution: Detect '*.bp' files as blueprint files, add
          a minimal filetype plugin (Bruno Belanyi)

See: https://source.android.com/docs/setup/build

closes: #14488

Signed-off-by: Bruno BELANYI <bruno@belanyi.fr>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/filetype.vim
runtime/ftplugin/bp.vim [new file with mode: 0644]
src/testdir/test_filetype.vim
src/version.c

index 14f633a2acc222227353a512cdc0563b11ee3eb5..99ac2028e1609bba5067f33768f47b0b31e02b02 100644 (file)
@@ -2998,6 +2998,9 @@ au BufNewFile,BufRead *.txt
 " Blueprint markup files
 au BufNewFile,BufRead *.blp                    setf blueprint
 
+" Blueprint build system file
+au BufNewFile,BufRead *.bp                     setf bp
+
 " Use the filetype detect plugins.  They may overrule any of the previously
 " detected filetypes.
 runtime! ftdetect/*.vim
diff --git a/runtime/ftplugin/bp.vim b/runtime/ftplugin/bp.vim
new file mode 100644 (file)
index 0000000..cb925cb
--- /dev/null
@@ -0,0 +1,14 @@
+" Blueprint build system filetype plugin file
+" Language: Blueprint
+" Maintainer: Bruno BELANYI <bruno.vim@belanyi.fr>
+" Latest Revision: 2024-04-10
+
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+setlocal comments=b:#
+setlocal commentstring=#\ %s
+
+let b:undo_ftplugin = "setlocal comments< commentstring<"
index 0af6e63d874f2155b57f089ddd920ee5bd4f9713..ddcd243dd6fbff9a26405aa510c0554cc98dec92 100644 (file)
@@ -126,6 +126,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     blade: ['file.blade.php'],
     blank: ['file.bl'],
     blueprint: ['file.blp'],
+    bp: ['Android.bp'],
     bsdl: ['file.bsd', 'file.bsdl'],
     bst: ['file.bst'],
     bzl: ['file.bazel', 'file.bzl', 'WORKSPACE', 'WORKSPACE.bzlmod'],
index 2f049c9427d5bfcfe057faa27ff6196c6efe1708..5fb7b1f82b6809c97b0d807e3f26d8e3e46b5837 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    302,
 /**/
     301,
 /**/