diff --git a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp index f720a52e8..8ab622560 100644 --- a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp +++ b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp @@ -593,6 +593,25 @@ void XmlMatchedTagsHighlighter::tagMatch(bool doHiliteAttr) if (lang != L_XML && lang != L_HTML && lang != L_PHP && lang != L_ASP && lang != L_JSP) return; + // If we're inside a code block (i.e not markup), don't try to match tags. + if (lang == L_PHP || lang == L_ASP || lang == L_JSP) + { + std::string codeBeginTag = lang == L_PHP ? "" : "%>"; + + const int caret = 1 + _pEditView->execute(SCI_GETCURRENTPOS); // +1 to deal with the case when the caret is between the angle and the question mark in "execute(SCI_GETTARGETSTART); int originalEndPos = _pEditView->execute(SCI_GETTARGETEND);