mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
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
This commit is contained in:
parent
a51e62c16d
commit
ef8ad111e9
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user