Fix crash due to backups and session snapshots

(Closes #1070)
When backups and session snapshots feature is enabled, batch
modification a big file could make Notepad++ crash. The solution is to
prevent from backing up modified file during the operation of batch
modification.
This commit is contained in:
Don Ho 2015-10-31 14:54:32 +01:00
parent 3733d97146
commit 94bddd5a85

View File

@ -47,6 +47,7 @@
#include "ProjectPanel.h" #include "ProjectPanel.h"
#include "documentMap.h" #include "documentMap.h"
#include "functionListPanel.h" #include "functionListPanel.h"
#include "LongRunningOperation.h"
using namespace std; using namespace std;
@ -1939,6 +1940,8 @@ void Notepad_plus::copyMarkedLines()
void Notepad_plus::cutMarkedLines() void Notepad_plus::cutMarkedLines()
{ {
LongRunningOperation op;
int lastLine = _pEditView->lastZeroBasedLineNumber(); int lastLine = _pEditView->lastZeroBasedLineNumber();
generic_string globalStr = TEXT(""); generic_string globalStr = TEXT("");
@ -1959,6 +1962,8 @@ void Notepad_plus::cutMarkedLines()
void Notepad_plus::deleteMarkedLines(bool isMarked) void Notepad_plus::deleteMarkedLines(bool isMarked)
{ {
LongRunningOperation op;
int lastLine = _pEditView->lastZeroBasedLineNumber(); int lastLine = _pEditView->lastZeroBasedLineNumber();
_pEditView->execute(SCI_BEGINUNDOACTION); _pEditView->execute(SCI_BEGINUNDOACTION);
@ -1972,6 +1977,8 @@ void Notepad_plus::deleteMarkedLines(bool isMarked)
void Notepad_plus::pasteToMarkedLines() void Notepad_plus::pasteToMarkedLines()
{ {
LongRunningOperation op;
int clipFormat; int clipFormat;
clipFormat = CF_UNICODETEXT; clipFormat = CF_UNICODETEXT;