From 1eba16d3a200ab3fa4b1d194880e78d2ac9abae8 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 19 Sep 2013 17:37:33 +0000 Subject: [PATCH] [BUG_FIXED] (Author: Andreas Jonsson) Disable tag matching inside PHP code blocks. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1123 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../xmlMatchedTagsHighlighter.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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);