mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-22 21:34:58 +02:00
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:
parent
3d1aa408dd
commit
ad6b9085dd
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "xmlMatchedTagsHighlighter.h"
|
#include "xmlMatchedTagsHighlighter.h"
|
||||||
#include "ScintillaEditView.h"
|
#include "ScintillaEditView.h"
|
||||||
|
#include <shlwapi.h>
|
||||||
|
|
||||||
using namespace std;
|
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)
|
XmlMatchedTagsHighlighter::FindResult XmlMatchedTagsHighlighter::findText(const char *text, intptr_t start, intptr_t end, int flags)
|
||||||
{
|
{
|
||||||
FindResult returnValue;
|
FindResult returnValue;
|
||||||
|
|
||||||
Sci_TextToFindFull search{};
|
Sci_TextToFindFull search{};
|
||||||
search.lpstrText = const_cast<char *>(text); // Grrrrrr
|
search.lpstrText = const_cast<char *>(text); // Grrrrrr
|
||||||
search.chrg.cpMin = static_cast<Sci_Position>(start);
|
search.chrg.cpMin = static_cast<Sci_Position>(start);
|
||||||
search.chrg.cpMax = static_cast<Sci_Position>(end);
|
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));
|
intptr_t result = _pEditView->execute(SCI_FINDTEXTFULL, flags, reinterpret_cast<LPARAM>(&search));
|
||||||
if (-1 == result)
|
if (-1 == result)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user