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

e54a8e7c73

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
This commit is contained in:
zeertzjq
2024-04-12 17:06:21 +08:00
committed by GitHub
parent a93a045e63
commit e4fb3e2007
2 changed files with 4 additions and 1 deletions

View File

@ -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',

View File

@ -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'],