diff --git a/PowerEditor/src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp b/PowerEditor/src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp index 4e24051b9..1d1aa10b0 100644 --- a/PowerEditor/src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp +++ b/PowerEditor/src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp @@ -22,6 +22,7 @@ #include "xmlMatchedTagsHighlighter.h" #include "ScintillaEditView.h" +#include using namespace std; @@ -563,11 +564,16 @@ XmlMatchedTagsHighlighter::FindResult XmlMatchedTagsHighlighter::findCloseTag(co XmlMatchedTagsHighlighter::FindResult XmlMatchedTagsHighlighter::findText(const char *text, intptr_t start, intptr_t end, int flags) { FindResult returnValue; - + Sci_TextToFindFull search{}; search.lpstrText = const_cast(text); // Grrrrrr search.chrg.cpMin = static_cast(start); search.chrg.cpMax = static_cast(end); + + LangType lang = (_pEditView->getCurrentBuffer())->getLangType(); + if (lang == L_XML || (lang == L_HTML && generic_stricmp(PathFindExtension((_pEditView->getCurrentBuffer())->getFileName()), TEXT(".xhtml")) == 0)) + flags = flags | SCFIND_MATCHCASE; + intptr_t result = _pEditView->execute(SCI_FINDTEXTFULL, flags, reinterpret_cast(&search)); if (-1 == result) {