[NEW_FEATURE] (Author: Etienne Boireau) While current file is closed the previous activated file will be activated (MRU).
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1282 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
57633249ab
commit
9dd5e62802
|
@ -3017,18 +3017,28 @@ bool Notepad_plus::removeBufferFromView(BufferID id, int whichOne)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int toActivate = 0;
|
BufferID bufferToActivate = NULL;
|
||||||
//activate next doc, otherwise prev if not possible
|
if (NppParameters::getInstance()->getNppGUI()._styleMRU) // If Most-Recently-Used mode:
|
||||||
if (active == tabToClose->nbItem() - 1) //prev
|
{ // Activate Most-Recently-Used doc:
|
||||||
{
|
TaskListInfo taskListInfo;
|
||||||
toActivate = active - 1;
|
::SendMessage(_pPublicInterface->getHSelf(), WM_GETTASKLISTINFO, (WPARAM)&taskListInfo, 0);
|
||||||
|
bufferToActivate = static_cast<BufferID>(taskListInfo._tlfsLst[1]._bufID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{ // Activate next doc, otherwise previous if not possible:
|
||||||
toActivate = active; //activate the 'active' index. Since we remove the tab first, the indices shift (on the right side)
|
int toActivate = 0;
|
||||||
|
if (active == tabToClose->nbItem() - 1) // If last doc:
|
||||||
|
{
|
||||||
|
toActivate = active - 1; // Activate previous doc.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
toActivate = active + 1; // Activate next doc.
|
||||||
|
}
|
||||||
|
bufferToActivate = tabToClose->getBufferByIndex(toActivate);
|
||||||
}
|
}
|
||||||
tabToClose->deletItemAt((size_t)index); //delete first
|
tabToClose->deletItemAt((size_t)index); //delete first
|
||||||
activateBuffer(tabToClose->getBufferByIndex(toActivate), whichOne); //then activate. The prevent jumpy tab behaviour
|
activateBuffer(bufferToActivate, whichOne); //then activate. The prevent jumpy tab behaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue