Fix delay because of folding tests.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@295 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
harrybharry 2008-07-17 15:47:26 +00:00
parent 4ae42c5654
commit 45c7e78024

View File

@ -1799,22 +1799,33 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_MODIFIED:
{
if ((notification->modificationType & SC_MOD_DELETETEXT) || (notification->modificationType & SC_MOD_INSERTTEXT))
static bool prevWasEdit = false;
if (notification->modificationType & (SC_MOD_DELETETEXT | SC_MOD_INSERTTEXT))
{
prevWasEdit = true;
_linkTriggered = true;
_isDocModifing = true;
::InvalidateRect(notifyView->getHSelf(), NULL, TRUE);
}
if (notification->modificationType & SC_MOD_CHANGEFOLD)
{
notifyView->foldChanged(notification->line,
notification->foldLevelNow, notification->foldLevelPrev);
if (prevWasEdit) {
notifyView->foldChanged(notification->line,
notification->foldLevelNow, notification->foldLevelPrev);
prevWasEdit = false;
}
}
else
if (!(notification->modificationType & (SC_MOD_DELETETEXT | SC_MOD_INSERTTEXT)))
{
prevWasEdit = false;
}
}
break;
case SCN_SAVEPOINTREACHED:
case SCN_SAVEPOINTLEFT: {
case SCN_SAVEPOINTLEFT:
{
Buffer * buf = 0;
if (isFromPrimary) {
buf = _mainEditView.getCurrentBuffer();
@ -2159,7 +2170,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
}
case SCN_MARGINCLICK:
case SCN_MARGINCLICK:
{
if (notification->nmhdr.hwndFrom == _mainEditView.getHSelf())
switchEditViewTo(MAIN_VIEW);
@ -2228,7 +2239,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
break;
}
case TTN_GETDISPINFO:
case TTN_GETDISPINFO:
{
LPTOOLTIPTEXT lpttt;