mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
[NEW_FEATURE] Add file switcher (list) dialog (in progress).
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@784 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
f002d94ff9
commit
5d8355de60
@ -312,15 +312,18 @@ void Notepad_plus::doClose(BufferID id, int whichOne) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int nrDocs = whichOne==MAIN_VIEW?(_mainDocTab.nbItem()):(_subDocTab.nbItem());
|
int nrDocs = whichOne==MAIN_VIEW?(_mainDocTab.nbItem()):(_subDocTab.nbItem());
|
||||||
|
|
||||||
//Do all the works
|
//Do all the works
|
||||||
bool isBufRemoved = removeBufferFromView(id, whichOne);
|
bool isBufRemoved = removeBufferFromView(id, whichOne);
|
||||||
|
int hiddenBufferID = -1;
|
||||||
if (nrDocs == 1 && canHideView(whichOne))
|
if (nrDocs == 1 && canHideView(whichOne))
|
||||||
{ //close the view if both visible
|
{ //close the view if both visible
|
||||||
hideView(whichOne);
|
hideView(whichOne);
|
||||||
|
|
||||||
|
// if the current activated buffer is in this view,
|
||||||
|
// then get buffer ID to remove the entry from File Switcher Pannel
|
||||||
|
hiddenBufferID = ::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETBUFFERIDFROMPOS, 0, whichOne);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify plugins that current file is closed
|
// Notify plugins that current file is closed
|
||||||
@ -328,8 +331,17 @@ void Notepad_plus::doClose(BufferID id, int whichOne) {
|
|||||||
{
|
{
|
||||||
scnN.nmhdr.code = NPPN_FILECLOSED;
|
scnN.nmhdr.code = NPPN_FILECLOSED;
|
||||||
_pluginsManager.notify(&scnN);
|
_pluginsManager.notify(&scnN);
|
||||||
|
|
||||||
|
// The document could be clonned.
|
||||||
|
// if the same buffer ID is not found then remove the entry from File Switcher Pannel
|
||||||
if (_pFileSwitcherPanel)
|
if (_pFileSwitcherPanel)
|
||||||
_pFileSwitcherPanel->closeItem((int)id);
|
{
|
||||||
|
if (::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETPOSFROMBUFFERID, (WPARAM)id ,0) == -1)
|
||||||
|
_pFileSwitcherPanel->closeItem((int)id);
|
||||||
|
|
||||||
|
if (hiddenBufferID != -1)
|
||||||
|
_pFileSwitcherPanel->closeItem((int)hiddenBufferID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user