[CODE_REORGANISATION] reorganisation xmlMatchedTagsHighlighter class.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@285 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-07-09 23:30:47 +00:00
parent 4748f3fa37
commit c9e76e0193
3 changed files with 10 additions and 9 deletions

View File

@ -2213,8 +2213,13 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_UPDATEUI:
{
braceMatch();
XmlMatchedTagsHighlighter xmlTagMatchHiliter(_pEditView);
xmlTagMatchHiliter.tagMatch();
const NppGUI & nppGUI = (NppParameters::getInstance())->getNppGUI();
if (nppGUI._enableTagsMatchHilite)
{
XmlMatchedTagsHighlighter xmlTagMatchHiliter(_pEditView);
xmlTagMatchHiliter.tagMatch(nppGUI._enableTagAttrsHilite);
}
markSelectedText();
updateStatusBar();
AutoCompletion * autoC = isFromPrimary?&_autoCompleteMain:&_autoCompleteSub;

View File

@ -387,12 +387,8 @@ vector< pair<int, int> > XmlMatchedTagsHighlighter::getAttributesPos(int start,
void XmlMatchedTagsHighlighter::tagMatch()
void XmlMatchedTagsHighlighter::tagMatch(bool doHiliteAttr)
{
const NppGUI & nppGUI = (NppParameters::getInstance())->getNppGUI();
if (!nppGUI._enableTagsMatchHilite)
return;
// Clean up all marks of previous action
_pEditView->clearIndicator(SCE_UNIVERSAL_TAGMATCH);
_pEditView->clearIndicator(SCE_UNIVERSAL_TAGATTR);
@ -425,7 +421,7 @@ void XmlMatchedTagsHighlighter::tagMatch()
_pEditView->execute(SCI_INDICATORFILLRANGE, xmlTags.tagOpenStart, xmlTags.tagNameEnd - xmlTags.tagOpenStart);
_pEditView->execute(SCI_INDICATORFILLRANGE, xmlTags.tagOpenEnd - openTagTailLen, openTagTailLen);
if (nppGUI._enableTagAttrsHilite)
if (doHiliteAttr)
{
vector< pair<int, int> > attributes = getAttributesPos(xmlTags.tagNameEnd, xmlTags.tagOpenEnd - openTagTailLen);
_pEditView->execute(SCI_SETINDICATORCURRENT, SCE_UNIVERSAL_TAGATTR);

View File

@ -28,7 +28,7 @@ enum TagCateg {tagOpen, tagClose, inSingleTag, outOfTag, invalidTag, unknownPb};
class XmlMatchedTagsHighlighter {
public:
XmlMatchedTagsHighlighter(ScintillaEditView *pEditView):_pEditView(pEditView){};
void tagMatch();
void tagMatch(bool doHiliteAttr);
private:
struct XmlMatchedTagsPos {