Mercurial > vim
changeset 34873:1707288c0b15 v9.1.0303
patch 9.1.0303: filetype: some protocol buffer files not recognized
Commit: https://github.com/vim/vim/commit/e54a8e7c73bbfba0c77e928f27fb3a9bffd2e8fd
Author: Bruno BELANYI <bruno@belanyi.fr>
Date: Wed Apr 10 22:34:42 2024 +0200
patch 9.1.0303: filetype: some protocol buffer files not recognized
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: #14463
Signed-off-by: Bruno BELANYI <bruno@belanyi.fr>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 10 Apr 2024 22:45:04 +0200 |
parents | d8c90ada53f5 |
children | 9ea00d55f503 |
files | runtime/filetype.vim src/testdir/test_filetype.vim src/version.c |
diffstat | 3 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1787,7 +1787,7 @@ au BufNewFile,BufRead *.psl setf psl " Google protocol buffers au BufNewFile,BufRead *.proto setf proto -au BufNewFile,BufRead *.pbtxt setf pbtxt +au BufNewFile,BufRead *.txtpb,*.textproto,*.textpb,*.pbtxt setf pbtxt " Poke au BufNewFile,BufRead *.pk setf poke
--- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -522,7 +522,7 @@ def s:GetFilenameChecks(): dict<list<str 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'],