]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0303: filetype: some protocol buffer files not recognized v9.1.0303
authorBruno BELANYI <bruno@belanyi.fr>
Wed, 10 Apr 2024 20:34:42 +0000 (22:34 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 10 Apr 2024 20:34:42 +0000 (22:34 +0200)
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>
runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index 99ac2028e1609bba5067f33768f47b0b31e02b02..732362d2a3913bb7dd0aa7c4058fd92b346ef7b3 100644 (file)
@@ -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
index ddcd243dd6fbff9a26405aa510c0554cc98dec92..5d42cc55e17789a3c35ccda05e9a9aeb6c2ff001 100644 (file)
@@ -522,7 +522,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     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'],
index 5fb7b1f82b6809c97b0d807e3f26d8e3e46b5837..65b5bd5b3960482ee75cce05276f3fa7263bcd4b 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    303,
 /**/
     302,
 /**/