From 5aab10a730b0c546486eaa8adeeed381fa76ba88 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 18 Apr 2010 07:37:30 +0000 Subject: [PATCH] [BUG_FIXED] Fix closing several detected non-existing files bug. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@630 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 88fc72dac..f85fe9a14 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -334,9 +334,18 @@ void FileManager::init(Notepad_plus * pNotepadPlus, ScintillaEditView * pscratch } void FileManager::checkFilesystemChanges() { - for(size_t i = 0; i < _nrBufs; i++) { + for(int i = int(_nrBufs -1) ; i >= 0 ; i--) + { + if (i >= int(_nrBufs)) + { + if (_nrBufs == 0) + return; + + i = _nrBufs - 1; + } _buffers[i]->checkFileState(); //something has changed. Triggers update automatically } + } int FileManager::getBufferIndexByID(BufferID id) {