Skip to content

Commit

Permalink
Update PHP file detection, add *.phps file extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Nov 15, 2022
1 parent 76397b8 commit 44ab85a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/FileExt.txt
Expand Up @@ -85,6 +85,7 @@ JSON Document

PHP Script
php
phps PHP Source
phpt PHP Test Script
phtml PHP Web Page
php_cs PHP-CS-Fixer
Expand Down
2 changes: 1 addition & 1 deletion src/EditLexers/stlPHP.c
Expand Up @@ -462,7 +462,7 @@ EDITLEXER lexPHP = {
},
//Settings--Autogenerated -- end of section automatically generated
EDITLEXER_HOLE(L"PHP Script", Styles_PHP),
L"php; phpt; phtml; php_cs; eyecode",
L"php; phps; phpt; phtml; php_cs; eyecode",
&Keywords_PHP,
Styles_PHP
};
4 changes: 3 additions & 1 deletion src/Styles.c
Expand Up @@ -2611,7 +2611,9 @@ bool Style_SetLexerFromFile(LPCWSTR lpszFile) {
// some conf/cfg file is xml
pLexNew = &lexXML;
} else if (!pLexNew) {
if (StrStartsWithCase(p, "<!DOCTYPE")) {
if (StrStartsWith(p, "<?php")) {
pLexNew = &lexPHP;
} else if (StrStartsWithCase(p, "<!DOCTYPE")) {
pLexNew = &lexXML;
} else if (StrStartsWithCase(p, "<html")) {
pLexNew = &lexHTML;
Expand Down

0 comments on commit 44ab85a

Please sign in to comment.