From 8c25dbff468a6360ac8e22ba1e3fec659db16ab8 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 7 Apr 2022 20:24:55 +0200 Subject: [PATCH] vim-patch:8.2.4708: PHP test files are not recognized (#18025) Problem: PHP test files are not recognized. Solution: Add the *.phpt pattern. (Julien Voisin, closes vim/vim#10112) https://github.com/vim/vim/commit/177847e67a495f80a15b6dfd0a3fcd151b44249e --- runtime/filetype.vim | 7 ++++--- runtime/lua/vim/filetype.lua | 1 + src/nvim/testdir/test_filetype.vim | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index d7a3ec182f..bc94ea848c 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1348,9 +1348,10 @@ au BufNewFile,BufRead *.pm au BufNewFile,BufRead *.pod setf pod " Php, php3, php4, etc. -" Also Phtml (was used for PHP 2 in the past) -" Also .ctp for Cake template file -au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp setf php +" Also Phtml (was used for PHP 2 in the past). +" Also .ctp for Cake template file. +" Also .phpt for php tests. +au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp,*.phpt setf php " PHP config au BufNewFile,BufRead php.ini-* setf dosini diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 0466057d72..6d8f734bed 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -457,6 +457,7 @@ local extension = { al = "perl", ctp = "php", php = "php", + phpt = "php", phtml = "php", pike = "pike", pmod = "pike", diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index a31ff50a48..42271a014d 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -395,7 +395,7 @@ let s:filename_checks = { \ 'perl': ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc'], \ 'pf': ['pf.conf'], \ 'pfmain': ['main.cf'], - \ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp'], + \ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp', 'file.phpt'], \ 'lpc': ['file.lpc', 'file.ulpc'], \ 'pike': ['file.pike', 'file.pmod'], \ 'cmod': ['file.cmod'],