Fix smart-highlighting not applying to cloned view
Fixed smart-highlighting not applying to cloned view while "Highlight another view" is enabled. Fix #7910, close #8905
This commit is contained in:
parent
c94f84000b
commit
139e4d4925
@ -862,8 +862,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||
if (notification->nmhdr.hwndFrom != _pEditView->getHSelf()) // notification come from unfocus view - both views ae visible
|
||||
{
|
||||
//ScintillaEditView * unfocusView = isFromPrimary ? &_subEditView : &_mainEditView;
|
||||
if (nppGui._smartHiliteOnAnotherView &&
|
||||
_pEditView->getCurrentBufferID() != notifyView->getCurrentBufferID())
|
||||
if (nppGui._smartHiliteOnAnotherView)
|
||||
{
|
||||
TCHAR selectedText[1024];
|
||||
_pEditView->getGenericSelectedText(selectedText, sizeof(selectedText)/sizeof(TCHAR), false);
|
||||
|
@ -171,11 +171,15 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView, Scintil
|
||||
|
||||
highlightViewWithWord(pHighlightView, text2FindW);
|
||||
|
||||
if (nppGUI._smartHiliteOnAnotherView && unfocusView && unfocusView->isVisible()
|
||||
&& unfocusView->getCurrentBufferID() != pHighlightView->getCurrentBufferID())
|
||||
if (nppGUI._smartHiliteOnAnotherView && unfocusView && unfocusView->isVisible())
|
||||
{
|
||||
// Clear the indicator only when the view is not a clone, or it will clear what we have already hightlighted in the pHighlightView
|
||||
if (unfocusView->getCurrentBufferID() != pHighlightView->getCurrentBufferID())
|
||||
{
|
||||
// Clear marks
|
||||
unfocusView->clearIndicator(SCE_UNIVERSAL_FOUND_STYLE_SMART);
|
||||
}
|
||||
|
||||
// Hightlight the unfocused view even if it's a clone, as it might be in a different area of the document
|
||||
highlightViewWithWord(unfocusView, text2FindW);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user