Fix a regression of double click on several zones of status bar.

pull/2461/merge
Don Ho 8 years ago
parent 3924190fb1
commit 1b66acd5e9

@ -49,8 +49,6 @@ BOOL Notepad_plus::notify(SCNotification *notification)
notifyView = &_mainEditView; notifyView = &_mainEditView;
else if (isFromSecondary) else if (isFromSecondary)
notifyView = &_subEditView; notifyView = &_subEditView;
else
return FALSE;
DocTabView *notifyDocTab = isFromPrimary?&_mainDocTab:&_subDocTab; DocTabView *notifyDocTab = isFromPrimary?&_mainDocTab:&_subDocTab;
TBHDR * tabNotification = (TBHDR*) notification; TBHDR * tabNotification = (TBHDR*) notification;
@ -58,6 +56,9 @@ BOOL Notepad_plus::notify(SCNotification *notification)
{ {
case SCN_MODIFIED: case SCN_MODIFIED:
{ {
if (not notifyView)
return FALSE;
static bool prevWasEdit = false; static bool prevWasEdit = false;
if (notification->modificationType & (SC_MOD_DELETETEXT | SC_MOD_INSERTTEXT)) if (notification->modificationType & (SC_MOD_DELETETEXT | SC_MOD_INSERTTEXT))
{ {
@ -543,6 +544,9 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_DOUBLECLICK: case SCN_DOUBLECLICK:
{ {
if (not notifyView)
return FALSE;
if (notification->modifiers == SCMOD_CTRL) if (notification->modifiers == SCMOD_CTRL)
{ {
const NppGUI & nppGUI = NppParameters::getInstance()->getNppGUI(); const NppGUI & nppGUI = NppParameters::getInstance()->getNppGUI();
@ -700,6 +704,9 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_UPDATEUI: case SCN_UPDATEUI:
{ {
if (not notifyView)
return FALSE;
NppParameters *nppParam = NppParameters::getInstance(); NppParameters *nppParam = NppParameters::getInstance();
NppGUI & nppGui = const_cast<NppGUI &>(nppParam->getNppGUI()); NppGUI & nppGui = const_cast<NppGUI &>(nppParam->getNppGUI());
@ -820,6 +827,9 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_ZOOM: case SCN_ZOOM:
{ {
if (not notifyView)
return FALSE;
ScintillaEditView * unfocusView = isFromPrimary ? &_subEditView : &_mainEditView; ScintillaEditView * unfocusView = isFromPrimary ? &_subEditView : &_mainEditView;
_smartHighlighter.highlightView(notifyView, unfocusView); _smartHighlighter.highlightView(notifyView, unfocusView);
break; break;
@ -840,7 +850,11 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_PAINTED: case SCN_PAINTED:
{ {
//--FLS: ViewMoveAtWrappingDisableFix: Disable wrapping messes up visible lines. Therefore save view position before in IDM_VIEW_WRAP and restore after SCN_PAINTED, as doc. says if (not notifyView)
return FALSE;
// ViewMoveAtWrappingDisableFix: Disable wrapping messes up visible lines.
// Therefore save view position before in IDM_VIEW_WRAP and restore after SCN_PAINTED, as doc. says
if (_mainEditView.isWrapRestoreNeeded()) if (_mainEditView.isWrapRestoreNeeded())
{ {
_mainEditView.restoreCurrentPos(); _mainEditView.restoreCurrentPos();
@ -877,6 +891,9 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_HOTSPOTDOUBLECLICK: case SCN_HOTSPOTDOUBLECLICK:
{ {
if (not notifyView)
return FALSE;
// Save the current wordChars before setting a custom list // Save the current wordChars before setting a custom list
const size_t wordBufferSize = notifyView->execute(SCI_GETWORDCHARS); const size_t wordBufferSize = notifyView->execute(SCI_GETWORDCHARS);
char *wordChars = new char[wordBufferSize + 1]; char *wordChars = new char[wordBufferSize + 1];

Loading…
Cancel
Save