Fix XML tag-matching not be case-sensitive

Make XML and XHTML tag matching case-sensitive.

Fix #10011, close #12688
This commit is contained in:
ArkadiuszMichalski 2022-12-22 07:12:36 +01:00 committed by Don Ho
parent 3d1aa408dd
commit ad6b9085dd

View File

@ -22,6 +22,7 @@
#include "xmlMatchedTagsHighlighter.h"
#include "ScintillaEditView.h"
#include <shlwapi.h>
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<char *>(text); // Grrrrrr
search.chrg.cpMin = static_cast<Sci_Position>(start);
search.chrg.cpMax = static_cast<Sci_Position>(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<LPARAM>(&search));
if (-1 == result)
{