From f53fa31a708806a958156063683b5b73bab55b99 Mon Sep 17 00:00:00 2001 From: donho Date: Wed, 25 Jun 2008 00:28:43 +0000 Subject: [PATCH] [BUG_FIXED] Fix NPPM_GETCURRENTIDEX bug. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@255 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index b6b090eaf..886801957 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -794,8 +794,14 @@ void Notepad_plus::doClose(BufferID id, int whichOne) { _lastRecentFileList.add(buf->getFilePath()); } + int nrDocs = _pDocTab->nbItem(); + //Do all the works removeBufferFromView(id, whichOne); + if (nrDocs == 1 && canHideView(currentView())) + { //close the view if both visible + hideView(whichOne); + } // Notify plugins that current file is closed scnN.nmhdr.code = NPPN_FILECLOSED; @@ -1146,11 +1152,11 @@ bool Notepad_plus::fileClose(BufferID id, int curView) if (curView != -1) viewToClose = curView; //first check amount of documents, we dont want the view to hide if we closed a secondary doc with primary being empty - int nrDocs = _pDocTab->nbItem(); + //int nrDocs = _pDocTab->nbItem(); doClose(bufferID, viewToClose); - if (nrDocs == 1 && canHideView(currentView())) { //close the view if both visible - hideView(viewToClose); - } + //if (nrDocs == 1 && canHideView(currentView())) { //close the view if both visible + // hideView(viewToClose); + //} return true; } @@ -1197,7 +1203,7 @@ bool Notepad_plus::fileCloseAll() for(int i = _pNonDocTab->nbItem() - 1; i >= 0; i--) { //close all from right to left doClose(_pNonDocTab->getBufferByIndex(i), otherView()); } - hideView(otherView()); + //hideView(otherView()); } activateBuffer(_pDocTab->getBufferByIndex(0), currentView()); @@ -1255,7 +1261,7 @@ bool Notepad_plus::fileCloseAllButCurrent() for(int i = _pNonDocTab->nbItem() - 1; i >= 0; i--) { //close all from right to left doClose(_pNonDocTab->getBufferByIndex(i), otherView()); } - hideView(otherView()); + //hideView(otherView()); } activateBuffer(_pDocTab->getBufferByIndex(0), currentView()); @@ -1849,8 +1855,8 @@ BOOL Notepad_plus::notify(SCNotification *notification) if (isFromPrimary || isFromSecondary) open = notifyDocTab->nbItem(); doClose(bufferToClose, iView); - if (open == 1 && canHideView(iView)) - hideView(iView); + //if (open == 1 && canHideView(iView)) + // hideView(iView); break; } @@ -4786,8 +4792,6 @@ void Notepad_plus::docGotoAnotherEditView(FileTransferMode mode) if (mode == TransferMove) { //just close the activate document, since thats the one we moved (no search) doClose(_pEditView->getCurrentBufferID(), currentView()); - if (canHideView(currentView())) - hideView(currentView()); } // else it was cone, so leave it //Activate the other view since thats where the document went