Fix slow tab switching while folding restoring.
Resolve slow tab switching of folded XML file by setting the isFolding flag to true, so it can ignore events while folding is taking place, when switching tabs and when loading the next tab after deleting a tab. (closes #168, fixes #236 #329)
This commit is contained in:
parent
fefdda75f6
commit
f02e567c9e
|
@ -3169,7 +3169,9 @@ bool Notepad_plus::removeBufferFromView(BufferID id, int whichOne)
|
||||||
toActivate = active; //activate the 'active' index. Since we remove the tab first, the indices shift (on the right side)
|
toActivate = active; //activate the 'active' index. Since we remove the tab first, the indices shift (on the right side)
|
||||||
}
|
}
|
||||||
tabToClose->deletItemAt((size_t)index); //delete first
|
tabToClose->deletItemAt((size_t)index); //delete first
|
||||||
|
_isFolding = true; // So we can ignore events while folding is taking place
|
||||||
activateBuffer(tabToClose->getBufferByIndex(toActivate), whichOne); //then activate. The prevent jumpy tab behaviour
|
activateBuffer(tabToClose->getBufferByIndex(toActivate), whichOne); //then activate. The prevent jumpy tab behaviour
|
||||||
|
_isFolding = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -263,8 +263,11 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||||
switchEditViewTo(iView);
|
switchEditViewTo(iView);
|
||||||
BufferID bufid = _pDocTab->getBufferByIndex(_pDocTab->getCurrentTabIndex());
|
BufferID bufid = _pDocTab->getBufferByIndex(_pDocTab->getCurrentTabIndex());
|
||||||
if (bufid != BUFFER_INVALID)
|
if (bufid != BUFFER_INVALID)
|
||||||
|
{
|
||||||
|
_isFolding = true; // So we can ignore events while folding is taking place
|
||||||
activateBuffer(bufid, iView);
|
activateBuffer(bufid, iView);
|
||||||
|
_isFolding = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue