vim-patch:9.0.0427: Drupal theme files are not recognized (#20138)

Problem:    Drupal theme files are not recognized.
Solution:   Use php filetype for Drupl theme files.  Remove trailing spaces.
            (Rodrigo Aguilera, closes vim/vim#11096)
8995c4cd4e
This commit is contained in:
Christian Clason
2022-09-09 18:48:12 +02:00
committed by GitHub
parent ad2d6a624b
commit 9b0e1256e2
3 changed files with 12 additions and 10 deletions

View File

@@ -1324,7 +1324,7 @@ au BufNewFile,BufRead *.or setf openroad
au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl
" OpenSCAD " OpenSCAD
au BufNewFile,BufRead *.scad setf openscad au BufNewFile,BufRead *.scad setf openscad
" Oracle config file " Oracle config file
au BufNewFile,BufRead *.ora setf ora au BufNewFile,BufRead *.ora setf ora
@@ -1399,7 +1399,8 @@ au BufNewFile,BufRead *.pod setf pod
" Also Phtml (was used for PHP 2 in the past). " Also Phtml (was used for PHP 2 in the past).
" Also .ctp for Cake template file. " Also .ctp for Cake template file.
" Also .phpt for php tests. " Also .phpt for php tests.
au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp,*.phpt setf php " Also .theme for Drupal theme files.
au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp,*.phpt,*.theme setf php
" PHP config " PHP config
au BufNewFile,BufRead php.ini-* setf dosini au BufNewFile,BufRead php.ini-* setf dosini

View File

@@ -746,6 +746,7 @@ local extension = {
php = 'php', php = 'php',
phpt = 'php', phpt = 'php',
phtml = 'php', phtml = 'php',
theme = 'php',
pike = 'pike', pike = 'pike',
pmod = 'pike', pmod = 'pike',
rcp = 'pilrc', rcp = 'pilrc',

View File

@@ -409,7 +409,7 @@ let s:filename_checks = {
\ 'perl': ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc'], \ 'perl': ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc'],
\ 'pf': ['pf.conf'], \ 'pf': ['pf.conf'],
\ 'pfmain': ['main.cf'], \ 'pfmain': ['main.cf'],
\ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp', 'file.phpt'], \ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp', 'file.phpt', 'file.theme'],
\ 'pike': ['file.pike', 'file.pmod'], \ 'pike': ['file.pike', 'file.pmod'],
\ 'pilrc': ['file.rcp'], \ 'pilrc': ['file.rcp'],
\ 'pine': ['.pinerc', 'pinerc', '.pinercex', 'pinercex'], \ 'pine': ['.pinerc', 'pinerc', '.pinercex', 'pinercex'],
@@ -534,7 +534,7 @@ let s:filename_checks = {
\ 'stata': ['file.ado', 'file.do', 'file.imata', 'file.mata'], \ 'stata': ['file.ado', 'file.do', 'file.imata', 'file.mata'],
\ 'stp': ['file.stp'], \ 'stp': ['file.stp'],
\ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp', '/etc/sudoers', 'any/etc/sudoers.d/file'], \ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp', '/etc/sudoers', 'any/etc/sudoers.d/file'],
\ 'supercollider': ['file.quark'], \ 'supercollider': ['file.quark'],
\ 'surface': ['file.sface'], \ 'surface': ['file.sface'],
\ 'svelte': ['file.svelte'], \ 'svelte': ['file.svelte'],
\ 'svg': ['file.svg'], \ 'svg': ['file.svg'],
@@ -1352,7 +1352,7 @@ func Test_mod_file()
unlet g:filetype_mod unlet g:filetype_mod
bwipe! bwipe!
" RAPID header start with a line containing only "%%%", " RAPID header start with a line containing only "%%%",
" but is not always present. " but is not always present.
call writefile(['%%%'], 'modfile.mod') call writefile(['%%%'], 'modfile.mod')
split modfile.mod split modfile.mod
@@ -1368,7 +1368,7 @@ func Test_mod_file()
bwipe! bwipe!
call delete('modfile.Mod') call delete('modfile.Mod')
" RAPID is not case sensitive, embedded spaces, sysmodule, " RAPID is not case sensitive, embedded spaces, sysmodule,
" file starts with empty line(s). " file starts with empty line(s).
call writefile(['', 'MODULE rapidmödüle (SYSMODULE,NOSTEPIN)'], 'modfile.MOD') call writefile(['', 'MODULE rapidmödüle (SYSMODULE,NOSTEPIN)'], 'modfile.MOD')
split modfile.MOD split modfile.MOD
@@ -1496,7 +1496,7 @@ func Test_prg_file()
unlet g:filetype_prg unlet g:filetype_prg
bwipe! bwipe!
" RAPID header start with a line containing only "%%%", " RAPID header start with a line containing only "%%%",
" but is not always present. " but is not always present.
call writefile(['%%%'], 'prgfile.prg') call writefile(['%%%'], 'prgfile.prg')
split prgfile.prg split prgfile.prg
@@ -1512,7 +1512,7 @@ func Test_prg_file()
bwipe! bwipe!
call delete('prgfile.Prg') call delete('prgfile.Prg')
" RAPID is not case sensitive, embedded spaces, sysmodule, " RAPID is not case sensitive, embedded spaces, sysmodule,
" file starts with empty line(s). " file starts with empty line(s).
call writefile(['', 'MODULE rapidmödüle (SYSMODULE,NOSTEPIN)'], 'prgfile.PRG') call writefile(['', 'MODULE rapidmödüle (SYSMODULE,NOSTEPIN)'], 'prgfile.PRG')
split prgfile.PRG split prgfile.PRG
@@ -1623,7 +1623,7 @@ func Test_sys_file()
unlet g:filetype_sys unlet g:filetype_sys
bwipe! bwipe!
" RAPID header start with a line containing only "%%%", " RAPID header start with a line containing only "%%%",
" but is not always present. " but is not always present.
call writefile(['%%%'], 'sysfile.sys') call writefile(['%%%'], 'sysfile.sys')
split sysfile.sys split sysfile.sys
@@ -1639,7 +1639,7 @@ func Test_sys_file()
bwipe! bwipe!
call delete('sysfile.Sys') call delete('sysfile.Sys')
" RAPID is not case sensitive, embedded spaces, sysmodule, " RAPID is not case sensitive, embedded spaces, sysmodule,
" file starts with empty line(s). " file starts with empty line(s).
call writefile(['', 'MODULE rapidmödüle (SYSMODULE,NOSTEPIN)'], 'sysfile.SYS') call writefile(['', 'MODULE rapidmödüle (SYSMODULE,NOSTEPIN)'], 'sysfile.SYS')
split sysfile.SYS split sysfile.SYS