From c9e76e019387891e9a70fc7ef20804fe91cc8393 Mon Sep 17 00:00:00 2001 From: donho Date: Wed, 9 Jul 2008 23:30:47 +0000 Subject: [PATCH] [CODE_REORGANISATION] reorganisation xmlMatchedTagsHighlighter class. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@285 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 9 +++++++-- .../src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp | 8 ++------ .../src/ScitillaComponent/xmlMatchedTagsHighlighter.h | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index a14e533db..6eb92f3ea 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -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; diff --git a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp index 6acb606fb..bf69cb988 100644 --- a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp +++ b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp @@ -387,12 +387,8 @@ vector< pair > 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 > attributes = getAttributesPos(xmlTags.tagNameEnd, xmlTags.tagOpenEnd - openTagTailLen); _pEditView->execute(SCI_SETINDICATORCURRENT, SCE_UNIVERSAL_TAGATTR); diff --git a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h index 9872a14b4..78701d37a 100644 --- a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h +++ b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h @@ -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 {