diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-04-12 17:05:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 17:05:11 +0800 |
commit | a93a045e63f96ba0b2b7f005818ddf16c2640038 (patch) | |
tree | 8a0e39cf045aed3dba09ef4114094a1553421360 | |
parent | da3059b00f96979691a420835f47d53fbef8db05 (diff) | |
download | rneovim-a93a045e63f96ba0b2b7f005818ddf16c2640038.tar.gz rneovim-a93a045e63f96ba0b2b7f005818ddf16c2640038.tar.bz2 rneovim-a93a045e63f96ba0b2b7f005818ddf16c2640038.zip |
vim-patch:9.1.0302: filetype: blueprint files are not recognized (#28292)
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: vim/vim#14488
https://github.com/vim/vim/commit/6be7ef5bc734ce6045d6f919f1a8559a3fa7f2fd
Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
-rw-r--r-- | runtime/ftplugin/bp.vim | 14 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 1 | ||||
-rw-r--r-- | test/old/testdir/test_filetype.vim | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/runtime/ftplugin/bp.vim b/runtime/ftplugin/bp.vim new file mode 100644 index 0000000000..cb925cb0ec --- /dev/null +++ b/runtime/ftplugin/bp.vim @@ -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<" diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index d7d34b625d..7de2a95c6b 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -236,6 +236,7 @@ local extension = { bbclass = 'bitbake', bl = 'blank', blp = 'blueprint', + bp = 'bp', bsd = 'bsdl', bsdl = 'bsdl', bst = 'bst', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 2cdcd72a8a..2caa9a5c39 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -127,6 +127,7 @@ func s:GetFilenameChecks() abort \ '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'], |