diff options
author | Christian Clason <c.clason@uni-graz.at> | 2024-07-06 18:00:09 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-07-07 00:36:40 +0200 |
commit | 472b5b9b20756146db39cf32c6fb678e1d8104c0 (patch) | |
tree | f78b1480f960dc04d6190a32dc46680d2fc0e2a9 | |
parent | 5da9b49b19240bb00f338249fef84a2bf1212b49 (diff) | |
download | rneovim-472b5b9b20756146db39cf32c6fb678e1d8104c0.tar.gz rneovim-472b5b9b20756146db39cf32c6fb678e1d8104c0.tar.bz2 rneovim-472b5b9b20756146db39cf32c6fb678e1d8104c0.zip |
vim-patch:9.1.0536: filetype: zone files are not recognized
Problem: filetype: zone files are not recognized
(rpdprd)
Solution: Detect '*.zone' files as bindzone filetype
fixes: vim/vim#14222
https://github.com/vim/vim/commit/f095539b3900d76f5eeaaa0897c6abf970829b31
Co-authored-by: Christian Brabandt <cb@256bit.org>
-rw-r--r-- | runtime/ftplugin/bindzone.vim | 16 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 1 | ||||
-rw-r--r-- | test/old/testdir/test_filetype.vim | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/runtime/ftplugin/bindzone.vim b/runtime/ftplugin/bindzone.vim new file mode 100644 index 0000000000..f9e5f4ba3c --- /dev/null +++ b/runtime/ftplugin/bindzone.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: bind zone file +" Maintainer: This runtime file is looking for a new maintainer. +" Last Change: 2024 Jul 06 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin=1 + +setlocal comments=b:; +setlocal commentstring=;\ %s +setlocal formatoptions-=t +setlocal formatoptions+=crq + +let b:undo_ftplugin = "setlocal com< cms< fo<" diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index d2cf87bea5..eae5817aee 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -236,6 +236,7 @@ local extension = { db = detect.bindzone, bicep = 'bicep', bicepparam = 'bicep', + zone = 'bindzone', bb = 'bitbake', bbappend = 'bitbake', bbclass = 'bitbake', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 5675068c71..8d2ea84a1b 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -122,7 +122,7 @@ func s:GetFilenameChecks() abort \ 'beancount': ['file.beancount'], \ 'bib': ['file.bib'], \ 'bicep': ['file.bicep', 'file.bicepparam'], - \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file'], + \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file', 'foobar.zone'], \ 'bitbake': ['file.bb', 'file.bbappend', 'file.bbclass', 'build/conf/local.conf', 'meta/conf/layer.conf', 'build/conf/bbappend.conf', 'meta-layer/conf/distro/foo.conf'], \ 'blade': ['file.blade.php'], \ 'blank': ['file.bl'], |