From 2fbac354ed00a7723b18f688f922a2ffb114cb13 Mon Sep 17 00:00:00 2001 From: Robert Di Pardo Date: Thu, 28 Apr 2022 20:31:17 -0400 Subject: [PATCH] Fix HTML syntax highlighting in PHP files regression Restore HTML syntax highlighting in PHP files. Fix #11585, fix #11602, close #11588 --- PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index a4db57136..5f57cd0e7 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -633,10 +633,10 @@ void ScintillaEditView::setStyle(Style styleToSet) void ScintillaEditView::setXmlLexer(LangType type) { - setLexerFromLangID(type); - if (type == L_XML) { + setLexerFromLangID(L_XML); + for (int i = 0 ; i < 4 ; ++i) execute(SCI_SETKEYWORDS, i, reinterpret_cast(TEXT(""))); @@ -646,6 +646,7 @@ void ScintillaEditView::setXmlLexer(LangType type) } else if ((type == L_HTML) || (type == L_PHP) || (type == L_ASP) || (type == L_JSP)) { + setLexerFromLangID(L_HTML); const TCHAR *htmlKeyWords_generic = NppParameters::getInstance().getWordList(L_HTML, LANG_INDEX_INSTR); WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); @@ -1426,7 +1427,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc) pStyle = stylers.findByID(defaultIndicatorStyle._styleID); setSpecialIndicator(pStyle ? *pStyle : defaultIndicatorStyle); - // Il faut surtout faire un test ici avant d'exécuter SCI_SETCODEPAGE + // Il faut surtout faire un test ici avant d'exécuter SCI_SETCODEPAGE // Sinon y'aura un soucis de performance! if (isCJK()) {