[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
This commit is contained in:
parent
481b80909e
commit
ea80233f65
|
@ -2221,6 +2221,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||||
XmlMatchedTagsHighlighter xmlTagMatchHiliter(_pEditView);
|
XmlMatchedTagsHighlighter xmlTagMatchHiliter(_pEditView);
|
||||||
xmlTagMatchHiliter.tagMatch(nppGUI._enableTagAttrsHilite);
|
xmlTagMatchHiliter.tagMatch(nppGUI._enableTagAttrsHilite);
|
||||||
}
|
}
|
||||||
|
|
||||||
markSelectedText();
|
markSelectedText();
|
||||||
updateStatusBar();
|
updateStatusBar();
|
||||||
AutoCompletion * autoC = isFromPrimary?&_autoCompleteMain:&_autoCompleteSub;
|
AutoCompletion * autoC = isFromPrimary?&_autoCompleteMain:&_autoCompleteSub;
|
||||||
|
|
|
@ -110,6 +110,11 @@ bool XmlMatchedTagsHighlighter::getMatchedTagPos(int searchStart, int searchEnd,
|
||||||
|
|
||||||
bool direction = searchEnd > searchStart;
|
bool direction = searchEnd > searchStart;
|
||||||
|
|
||||||
|
if ((direction == search2Left) && (searchStart <= searchEnd))
|
||||||
|
return false;
|
||||||
|
else if ((direction == search2Right) && (searchStart >= searchEnd))
|
||||||
|
return false;
|
||||||
|
|
||||||
pair<int, int> foundPos;
|
pair<int, int> foundPos;
|
||||||
int ltPosOnR = getFirstTokenPosFrom(searchStart, searchEnd, tag2find, foundPos);
|
int ltPosOnR = getFirstTokenPosFrom(searchStart, searchEnd, tag2find, foundPos);
|
||||||
if (ltPosOnR == -1)
|
if (ltPosOnR == -1)
|
||||||
|
@ -119,7 +124,7 @@ bool XmlMatchedTagsHighlighter::getMatchedTagPos(int searchStart, int searchEnd,
|
||||||
int idStyle = _pEditView->execute(SCI_GETSTYLEAT, ltPosOnR);
|
int idStyle = _pEditView->execute(SCI_GETSTYLEAT, ltPosOnR);
|
||||||
if (idStyle >= SCE_HJ_START)
|
if (idStyle >= SCE_HJ_START)
|
||||||
{
|
{
|
||||||
int start = foundPos.first;
|
int start = (direction == search2Left)?foundPos.first:foundPos.second;
|
||||||
int end = searchEnd;
|
int end = searchEnd;
|
||||||
return getMatchedTagPos(start, end, tag2find, oppositeTag2find, oppositeTagFound, tagsPos);
|
return getMatchedTagPos(start, end, tag2find, oppositeTag2find, oppositeTagFound, tagsPos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue