From ef8ad111e93e4b0b8bc1663f6e045916137bad18 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 6 Dec 2023 21:28:14 +0100 Subject: [PATCH] Enhance the performance: disable undo collection while loading a file This reduces the amount of memory required to load a file by around half. Close #14455 --- PowerEditor/src/ScintillaComponent/Buffer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index d239a0333..14f44cdf3 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -1594,6 +1594,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil _pscratchTilla->execute(SCI_SETREADONLY, false); } _pscratchTilla->execute(SCI_CLEARALL); + _pscratchTilla->execute(SCI_SETUNDOCOLLECTION, false); // disable undocollection while loading a file if (fileFormat._language < L_EXTERNAL) @@ -1769,6 +1770,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil _pscratchTilla->execute(SCI_EMPTYUNDOBUFFER); _pscratchTilla->execute(SCI_SETSAVEPOINT); + _pscratchTilla->execute(SCI_SETUNDOCOLLECTION, true); if (ro) _pscratchTilla->execute(SCI_SETREADONLY, true);