diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 81ff7f17..742bdd35 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -674,7 +674,7 @@ bool FileManager::reloadBuffer(BufferID id) buf->setLoadedDirty(false); // Since the buffer will be reloaded from the disk, and it will be clean (not dirty), we can set _isLoadedDirty false safetly. // Set _isLoadedDirty false before calling "_pscratchTilla->execute(SCI_CLEARALL);" in loadFileData() to avoid setDirty in SCN_SAVEPOINTREACHED / SCN_SAVEPOINTLEFT - bool res = loadFileData(doc, buf->getFullPathName(), data, &UnicodeConvertor, loadedFileFormat, false); + bool res = loadFileData(doc, buf->getFullPathName(), data, &UnicodeConvertor, loadedFileFormat); buf->_canNotify = true; if (res) @@ -1261,7 +1261,7 @@ LangType FileManager::detectLanguageFromTextBegining(const unsigned char *data, return L_TEXT; } -bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data, Utf8_16_Read * unicodeConvertor, LoadedFileFormat& fileFormat, bool purgeUndoBuffer) +bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data, Utf8_16_Read * unicodeConvertor, LoadedFileFormat& fileFormat) { FILE *fp = generic_fopen(filename, TEXT("rb")); if (not fp) @@ -1295,12 +1295,6 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data, { _pscratchTilla->execute(SCI_SETREADONLY, false); } - - if (!purgeUndoBuffer) - { - _pscratchTilla->execute(SCI_BEGINUNDOACTION); - } - _pscratchTilla->execute(SCI_CLEARALL); @@ -1433,7 +1427,7 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data, fileFormat._eolFormat = format; } - _pscratchTilla->execute(purgeUndoBuffer ? SCI_EMPTYUNDOBUFFER : SCI_ENDUNDOACTION); + _pscratchTilla->execute(SCI_EMPTYUNDOBUFFER); _pscratchTilla->execute(SCI_SETSAVEPOINT); if (ro) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.h b/PowerEditor/src/ScitillaComponent/Buffer.h index 59ac4873..784f155b 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.h +++ b/PowerEditor/src/ScitillaComponent/Buffer.h @@ -122,7 +122,7 @@ private: }; ~FileManager(); int detectCodepage(char* buf, size_t len); - bool loadFileData(Document doc, const TCHAR* filename, char* buffer, Utf8_16_Read* UnicodeConvertor, LoadedFileFormat& fileFormat, bool purgeUndoBuffer = true); + bool loadFileData(Document doc, const TCHAR* filename, char* buffer, Utf8_16_Read* UnicodeConvertor, LoadedFileFormat& fileFormat); LangType detectLanguageFromTextBegining(const unsigned char *data, size_t dataLen);