mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-22 05:14:41 +02:00
[BUG_FIXED] Fix tag highlighting bug while disabling indent guide lines.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@586 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
0d2eee4ed5
commit
ac118c6082
@ -2803,88 +2803,6 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
case SCN_UPDATEUI:
|
||||
{
|
||||
|
||||
NppParameters *nppParam = NppParameters::getInstance();
|
||||
|
||||
// if it's searching/replacing, then do nothing
|
||||
if (nppParam->_isFindReplacing)
|
||||
break;
|
||||
|
||||
if (notification->nmhdr.hwndFrom != _pEditView->getHSelf())
|
||||
break;
|
||||
|
||||
static NppGUI & nppGui = (NppGUI &)nppParam->getNppGUI();
|
||||
static StyleArray & stylers = nppParam->getMiscStylerArray();
|
||||
static int iBraceStyle = stylers.getStylerIndexByID(STYLE_BRACELIGHT);
|
||||
if (iBraceStyle != -1)
|
||||
{
|
||||
Style *pBraceStyle = &(stylers.getStyler(iBraceStyle));
|
||||
_pEditView->execute(SCI_STYLESETFORE, STYLE_BRACELIGHT, pBraceStyle->_fgColor);
|
||||
}
|
||||
|
||||
if (braceMatch())
|
||||
{
|
||||
_pEditView->clearIndicator(SCE_UNIVERSAL_TAGMATCH);
|
||||
_pEditView->clearIndicator(SCE_UNIVERSAL_TAGATTR);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nppGui._enableTagsMatchHilite)
|
||||
{
|
||||
XmlMatchedTagsHighlighter xmlTagMatchHiliter(_pEditView);
|
||||
pair<int, int> tagPos = xmlTagMatchHiliter.tagMatch(nppGui._enableTagAttrsHilite);
|
||||
|
||||
|
||||
int braceAtCaret = tagPos.first;
|
||||
int braceOpposite = tagPos.second;
|
||||
|
||||
if ((braceAtCaret != -1) && (braceOpposite == -1))
|
||||
{
|
||||
_pEditView->execute(SCI_SETHIGHLIGHTGUIDE, 0);
|
||||
}
|
||||
|
||||
else if (_pEditView->isShownIndentGuide())
|
||||
{
|
||||
int columnAtCaret = int(_pEditView->execute(SCI_GETCOLUMN, braceAtCaret));
|
||||
int columnOpposite = int(_pEditView->execute(SCI_GETCOLUMN, braceOpposite));
|
||||
|
||||
int lineAtCaret = int(_pEditView->execute(SCI_LINEFROMPOSITION, braceAtCaret));
|
||||
int lineOpposite = int(_pEditView->execute(SCI_LINEFROMPOSITION, braceOpposite));
|
||||
if (lineAtCaret != lineOpposite)
|
||||
{
|
||||
static int iTagMatchStyle = stylers.getStylerIndexByID(SCE_UNIVERSAL_TAGMATCH);
|
||||
if (iTagMatchStyle != -1)
|
||||
{
|
||||
Style *pTagStyle = &(stylers.getStyler(iTagMatchStyle));
|
||||
_pEditView->execute(SCI_STYLESETFORE, STYLE_BRACELIGHT, pTagStyle->_bgColor);
|
||||
}
|
||||
// braceAtCaret - 1, braceOpposite-1 : walk around to not highlight the '<'
|
||||
_pEditView->execute(SCI_BRACEHIGHLIGHT, braceAtCaret-1, braceOpposite-1);
|
||||
_pEditView->execute(SCI_SETHIGHLIGHTGUIDE, (columnAtCaret < columnOpposite)?columnAtCaret:columnOpposite);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (nppGui._enableSmartHilite)
|
||||
{
|
||||
if (nppGui._disableSmartHiliteTmp)
|
||||
nppGui._disableSmartHiliteTmp = false;
|
||||
else
|
||||
_smartHighlighter.highlightView(notifyView);
|
||||
}
|
||||
updateStatusBar();
|
||||
AutoCompletion * autoC = isFromPrimary?&_autoCompleteMain:&_autoCompleteSub;
|
||||
autoC->update(0);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
case SCN_SCROLLED:
|
||||
{
|
||||
const NppGUI & nppGUI = (NppParameters::getInstance())->getNppGUI();
|
||||
|
@ -489,16 +489,19 @@ void XmlMatchedTagsHighlighter::tagMatch(bool doHiliteAttr)
|
||||
}
|
||||
|
||||
// Colouising indent guide line position
|
||||
int columnAtCaret = int(_pEditView->execute(SCI_GETCOLUMN, xmlTags.tagOpenStart));
|
||||
int columnOpposite = int(_pEditView->execute(SCI_GETCOLUMN, xmlTags.tagCloseStart));
|
||||
if (_pEditView->isShownIndentGuide())
|
||||
{
|
||||
int columnAtCaret = int(_pEditView->execute(SCI_GETCOLUMN, xmlTags.tagOpenStart));
|
||||
int columnOpposite = int(_pEditView->execute(SCI_GETCOLUMN, xmlTags.tagCloseStart));
|
||||
|
||||
int lineAtCaret = int(_pEditView->execute(SCI_LINEFROMPOSITION, xmlTags.tagOpenStart));
|
||||
int lineOpposite = int(_pEditView->execute(SCI_LINEFROMPOSITION, xmlTags.tagCloseStart));
|
||||
int lineAtCaret = int(_pEditView->execute(SCI_LINEFROMPOSITION, xmlTags.tagOpenStart));
|
||||
int lineOpposite = int(_pEditView->execute(SCI_LINEFROMPOSITION, xmlTags.tagCloseStart));
|
||||
|
||||
if (xmlTags.tagCloseStart != -1 && lineAtCaret != lineOpposite)
|
||||
{
|
||||
_pEditView->execute(SCI_BRACEHIGHLIGHT, xmlTags.tagOpenStart, xmlTags.tagCloseEnd-1);
|
||||
_pEditView->execute(SCI_SETHIGHLIGHTGUIDE, (columnAtCaret < columnOpposite)?columnAtCaret:columnOpposite);
|
||||
if (xmlTags.tagCloseStart != -1 && lineAtCaret != lineOpposite)
|
||||
{
|
||||
_pEditView->execute(SCI_BRACEHIGHLIGHT, xmlTags.tagOpenStart, xmlTags.tagCloseEnd-1);
|
||||
_pEditView->execute(SCI_SETHIGHLIGHTGUIDE, (columnAtCaret < columnOpposite)?columnAtCaret:columnOpposite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user