Skip to content

Commit

Permalink
[NEW_FEATURE] Add file switcher (list) dialog (in progress).
Browse files Browse the repository at this point in the history
- Notepad-plus svn trunk @ 784
  • Loading branch information
donho committed Jun 30, 2011
1 parent afc9661 commit 1bef66e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions PowerEditor/src/NppIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,24 +312,36 @@ void Notepad_plus::doClose(BufferID id, int whichOne) {
}
}



int nrDocs = whichOne==MAIN_VIEW?(_mainDocTab.nbItem()):(_subDocTab.nbItem());

//Do all the works
bool isBufRemoved = removeBufferFromView(id, whichOne);
int hiddenBufferID = -1;
if (nrDocs == 1 && canHideView(whichOne))
{ //close the view if both visible
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
if (isBufRemoved)
{
scnN.nmhdr.code = NPPN_FILECLOSED;
_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)
_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;
}
Expand Down

0 comments on commit 1bef66e

Please sign in to comment.