aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-12 17:06:21 +0800
committerGitHub <noreply@github.com>2024-04-12 17:06:21 +0800
commite4fb3e200768763fbff8668c19b2011d6c8309aa (patch)
tree39c0c684d7efaa88bfc8c6d66c5ac637d4baab71
parenta93a045e63f96ba0b2b7f005818ddf16c2640038 (diff)
downloadrneovim-e4fb3e200768763fbff8668c19b2011d6c8309aa.tar.gz
rneovim-e4fb3e200768763fbff8668c19b2011d6c8309aa.tar.bz2
rneovim-e4fb3e200768763fbff8668c19b2011d6c8309aa.zip
vim-patch:9.1.0303: filetype: some protocol buffer files not recognized (#28293)
Problem: filetype: some protocol buffer files not recognized Solution: Detect '*.textproto', '*.textpb', '*.txtpb' as pbtxt files (Bruno Belanyi) See: https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files closes: vim/vim#14463 https://github.com/vim/vim/commit/e54a8e7c73bbfba0c77e928f27fb3a9bffd2e8fd Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
-rw-r--r--runtime/lua/vim/filetype.lua3
-rw-r--r--test/old/testdir/test_filetype.vim2
2 files changed, 4 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 7de2a95c6b..d2c6d87774 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -776,6 +776,9 @@ local extension = {
pas = 'pascal',
lpr = detect_line1('<%?xml', 'xml', 'pascal'),
dpr = 'pascal',
+ txtpb = 'pbtxt',
+ textproto = 'pbtxt',
+ textpb = 'pbtxt',
pbtxt = 'pbtxt',
g = 'pccts',
pcmk = 'pcmk',
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index 2caa9a5c39..d1f6950128 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -523,7 +523,7 @@ func s:GetFilenameChecks() abort
\ 'papp': ['file.papp', 'file.pxml', 'file.pxsl'],
\ 'pascal': ['file.pas', 'file.dpr', 'file.lpr'],
\ 'passwd': ['any/etc/passwd', 'any/etc/passwd-', 'any/etc/passwd.edit', 'any/etc/shadow', 'any/etc/shadow-', 'any/etc/shadow.edit', 'any/var/backups/passwd.bak', 'any/var/backups/shadow.bak', '/etc/passwd', '/etc/passwd-', '/etc/passwd.edit', '/etc/shadow', '/etc/shadow-', '/etc/shadow.edit', '/var/backups/passwd.bak', '/var/backups/shadow.bak'],
- \ 'pbtxt': ['file.pbtxt'],
+ \ 'pbtxt': ['file.txtpb', 'file.textproto', 'file.textpb', 'file.pbtxt'],
\ 'pccts': ['file.g'],
\ 'pcmk': ['file.pcmk'],
\ 'pdf': ['file.pdf'],