|
|
@ -2485,12 +2485,6 @@ TagCateg Notepad_plus::getTagCategory(XmlMatchedTagsPos & tagsPos, int curPos) |
|
|
|
|
|
|
|
|
|
|
|
bool Notepad_plus::getMatchedTagPos(int searchStart, int searchEnd, const char *tag2find, const char *oppositeTag2find, vector<int> oppositeTagFound, XmlMatchedTagsPos & tagsPos) |
|
|
|
bool Notepad_plus::getMatchedTagPos(int searchStart, int searchEnd, const char *tag2find, const char *oppositeTag2find, vector<int> oppositeTagFound, XmlMatchedTagsPos & tagsPos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
/*
|
|
|
|
|
|
|
|
char func[256]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sprintf(func, "getMatchedTagPos(%d, %d)", searchStart, searchEnd); |
|
|
|
|
|
|
|
writeLog("c:\\npplog", func); |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const bool search2Left = false; |
|
|
|
const bool search2Left = false; |
|
|
|
const bool search2Right = true; |
|
|
|
const bool search2Right = true; |
|
|
|
|
|
|
|
|
|
|
@ -2517,13 +2511,11 @@ bool Notepad_plus::getMatchedTagPos(int searchStart, int searchEnd, const char * |
|
|
|
|
|
|
|
|
|
|
|
if (ltTag == -1) |
|
|
|
if (ltTag == -1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (direction == search2Left) |
|
|
|
if (direction == search2Left) |
|
|
|
{ |
|
|
|
{ |
|
|
|
tagsPos.tagOpenStart = foundPos.first; |
|
|
|
return true;//(getTagCategory(tagsPos, ltPosOnR+2) == tagOpen);
|
|
|
|
tagsPos.tagOpenEnd = foundPos.second; |
|
|
|
//tagsPos.tagOpenStart = foundPos.first;
|
|
|
|
//tagsPos.tagNameEnd = ltTag + 1 + (endPos - startPos);
|
|
|
|
//tagsPos.tagOpenEnd = foundPos.second;
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -2541,8 +2533,7 @@ bool Notepad_plus::getMatchedTagPos(int searchStart, int searchEnd, const char * |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (direction == search2Left) |
|
|
|
if (direction == search2Left) |
|
|
|
{ |
|
|
|
{ |
|
|
|
tagsPos.tagOpenStart = foundPos.first; |
|
|
|
return true;//(getTagCategory(tagsPos, ltPosOnR+2) == tagOpen);
|
|
|
|
tagsPos.tagOpenEnd = foundPos.second; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -2556,7 +2547,15 @@ bool Notepad_plus::getMatchedTagPos(int searchStart, int searchEnd, const char * |
|
|
|
oppositeTagFound.push_back(ltTag); |
|
|
|
oppositeTagFound.push_back(ltTag); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
// else do nothing
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (direction == search2Left) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
XmlMatchedTagsPos tmpTagsPos; |
|
|
|
|
|
|
|
getTagCategory(tmpTagsPos, ltTag+1); |
|
|
|
|
|
|
|
ltTag = tmpTagsPos.tagCloseEnd; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|