[BUG_FIXED] Fix crash bug for tags match highlighting.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@291 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 17 years ago
parent 481b80909e
commit ea80233f65

@ -2221,6 +2221,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
XmlMatchedTagsHighlighter xmlTagMatchHiliter(_pEditView);
xmlTagMatchHiliter.tagMatch(nppGUI._enableTagAttrsHilite);
}
markSelectedText();
updateStatusBar();
AutoCompletion * autoC = isFromPrimary?&_autoCompleteMain:&_autoCompleteSub;

@ -110,6 +110,11 @@ bool XmlMatchedTagsHighlighter::getMatchedTagPos(int searchStart, int searchEnd,
bool direction = searchEnd > searchStart;
if ((direction == search2Left) && (searchStart <= searchEnd))
return false;
else if ((direction == search2Right) && (searchStart >= searchEnd))
return false;
pair<int, int> foundPos;
int ltPosOnR = getFirstTokenPosFrom(searchStart, searchEnd, tag2find, foundPos);
if (ltPosOnR == -1)
@ -119,7 +124,7 @@ bool XmlMatchedTagsHighlighter::getMatchedTagPos(int searchStart, int searchEnd,
int idStyle = _pEditView->execute(SCI_GETSTYLEAT, ltPosOnR);
if (idStyle >= SCE_HJ_START)
{
int start = foundPos.first;
int start = (direction == search2Left)?foundPos.first:foundPos.second;
int end = searchEnd;
return getMatchedTagPos(start, end, tag2find, oppositeTag2find, oppositeTagFound, tagsPos);
}

Loading…
Cancel
Save