Apply the better style on previous commit

This commit is contained in:
Don HO 2020-03-22 05:21:31 +01:00
parent d36ea6124a
commit 0c80bf8cb9
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
1 changed files with 6 additions and 4 deletions

View File

@ -3578,21 +3578,23 @@ 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)
}
if (NppParameters::getInstance().getNppGUI()._styleMRU)
{
// After closing a file choose the file to activate based on MRU list and not just last file in the list.
TaskListInfo taskListInfo;
::SendMessage(_pPublicInterface->getHSelf(), WM_GETTASKLISTINFO, (WPARAM)&taskListInfo, 0);
::SendMessage(_pPublicInterface->getHSelf(), WM_GETTASKLISTINFO, reinterpret_cast<WPARAM>(&taskListInfo), 0);
size_t i, n = taskListInfo._tlfsLst.size();
for (i = 0; i < n; i++)
{
TaskLstFnStatus& F = taskListInfo._tlfsLst[i];
if (F._iView != whichOne || F._bufID == (void*)id)
TaskLstFnStatus& tfs = taskListInfo._tlfsLst[i];
if (tfs._iView != whichOne || tfs._bufID == id)
continue;
toActivate = F._docIndex >= active ? F._docIndex - 1 : F._docIndex;
toActivate = tfs._docIndex >= active ? tfs._docIndex - 1 : tfs._docIndex;
break;
}
}
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