forked from aniani/vim
patch 8.2.2334: Pascal-like filetypes not always detected
Problem: Pascal-like filetypes not always detected.
Solution: Improved Puppet, InstantFPC and Pascal detection. (Doug Kearns,
closes #7662)
This commit is contained in:
@@ -348,7 +348,7 @@ let s:filename_checks = {
|
||||
\ 'pamconf': ['/etc/pam.conf', '/etc/pam.d/file', 'any/etc/pam.conf', 'any/etc/pam.d/file'],
|
||||
\ 'pamenv': ['/etc/security/pam_env.conf', '/home/user/.pam_environment', '.pam_environment', 'pam_env.conf'],
|
||||
\ 'papp': ['file.papp', 'file.pxml', 'file.pxsl'],
|
||||
\ 'pascal': ['file.pas', 'file.pp', 'file.dpr', 'file.lpr'],
|
||||
\ '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'],
|
||||
\ 'pccts': ['file.g'],
|
||||
@@ -384,6 +384,7 @@ let s:filename_checks = {
|
||||
\ 'proto': ['file.proto'],
|
||||
\ 'protocols': ['/etc/protocols', 'any/etc/protocols'],
|
||||
\ 'psf': ['file.psf'],
|
||||
\ 'puppet': ['file.pp'],
|
||||
\ 'pyrex': ['file.pyx', 'file.pxd'],
|
||||
\ 'python': ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 'file.ptl', 'file.pyi', 'SConstruct'],
|
||||
\ 'quake': ['anybaseq2/file.cfg', 'anyid1/file.cfg', 'quake3/file.cfg', 'baseq2/file.cfg', 'id1/file.cfg', 'quake1/file.cfg', 'some-baseq2/file.cfg', 'some-id1/file.cfg', 'some-quake1/file.cfg'],
|
||||
@@ -636,6 +637,7 @@ let s:script_checks = {
|
||||
\ 'cpp': [['// Standard iostream objects -*- C++ -*-'],
|
||||
\ ['// -*- C++ -*-']],
|
||||
\ 'yaml': [['%YAML 1.2']],
|
||||
\ 'pascal': [['#!/path/instantfpc']],
|
||||
\ }
|
||||
|
||||
" Various forms of "env" optional arguments.
|
||||
@@ -730,5 +732,33 @@ func Test_ts_file()
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_pp_file()
|
||||
filetype on
|
||||
|
||||
call writefile(['looks like puppet'], 'Xfile.pp')
|
||||
split Xfile.pp
|
||||
call assert_equal('puppet', &filetype)
|
||||
bwipe!
|
||||
|
||||
let g:filetype_pp = 'pascal'
|
||||
split Xfile.pp
|
||||
call assert_equal('pascal', &filetype)
|
||||
bwipe!
|
||||
|
||||
" Test dist#ft#FTpp()
|
||||
call writefile(['{ pascal comment'], 'Xfile.pp')
|
||||
split Xfile.pp
|
||||
call assert_equal('pascal', &filetype)
|
||||
bwipe!
|
||||
|
||||
call writefile(['procedure pascal'], 'Xfile.pp')
|
||||
split Xfile.pp
|
||||
call assert_equal('pascal', &filetype)
|
||||
bwipe!
|
||||
|
||||
call delete('Xfile.ts')
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2334,
|
||||
/**/
|
||||
2333,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user