Browse Source

[BUG_FIXED] Fix tags match highlighter bug - the none-html zone won't be highlight.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@286 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 17 years ago
parent
commit
096f030843
  1. 15
      PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp

15
PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp

@ -115,6 +115,15 @@ bool XmlMatchedTagsHighlighter::getMatchedTagPos(int searchStart, int searchEnd,
if (ltPosOnR == -1)
return false;
// if the tag is found in non html zone, we skip it
int idStyle = _pEditView->execute(SCI_GETSTYLEAT, ltPosOnR);
if (idStyle >= SCE_HJ_START)
{
int start = foundPos.first;
int end = searchEnd;
return getMatchedTagPos(start, end, tag2find, oppositeTag2find, oppositeTagFound, tagsPos);
}
TagCateg tc = outOfTag;
if (direction == search2Left)
{
@ -128,7 +137,6 @@ bool XmlMatchedTagsHighlighter::getMatchedTagPos(int searchStart, int searchEnd,
int end = searchEnd;
return getMatchedTagPos(start, end, tag2find, oppositeTag2find, oppositeTagFound, tagsPos);
}
//oppositeTagFound.push_back(foundPos.first);
}
pair<int, int> oppositeTagPos;
@ -214,6 +222,11 @@ bool XmlMatchedTagsHighlighter::getXmlMatchedTagsPos(XmlMatchedTagsPos & tagsPos
{
// get word where caret is on
int caretPos = _pEditView->execute(SCI_GETCURRENTPOS);
// if the tag is found in non html zone, then quit
int idStyle = _pEditView->execute(SCI_GETSTYLEAT, caretPos);
if (idStyle >= SCE_HJ_START)
return false;
int docLen = _pEditView->getCurrentDocLen();

Loading…
Cancel
Save