From ad6b9085ddf03ed71d35421995e6bb93d44d6f93 Mon Sep 17 00:00:00 2001 From: ArkadiuszMichalski <2730894+ArkadiuszMichalski@users.noreply.github.com> Date: Thu, 22 Dec 2022 07:12:36 +0100 Subject: [PATCH] Fix XML tag-matching not be case-sensitive Make XML and XHTML tag matching case-sensitive. Fix #10011, close #12688 --- .../src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) {