From eb1b7977f607826b46455f76389889ecdd770025 Mon Sep 17 00:00:00 2001 From: xomx Date: Fri, 2 May 2025 22:58:47 +0200 Subject: [PATCH] Enable Scintilla undo/redo selection history Ref: https://www.scintilla.org/ScintillaDoc.html#SCI_SETUNDOSELECTIONHISTORY Fix #16488, close #16496 --- PowerEditor/src/Notepad_plus.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 4ad209586..2a8367b95 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -386,6 +386,10 @@ LRESULT Notepad_plus::init(HWND hwnd) _mainEditView.execute(SCI_STYLESETCHECKMONOSPACED, STYLE_DEFAULT, true); _subEditView.execute(SCI_STYLESETCHECKMONOSPACED, STYLE_DEFAULT, true); + // Restore also the possible previous selection for each undo/redo op (memory cost min 150B for each op) + _mainEditView.execute(SCI_SETUNDOSELECTIONHISTORY, SC_UNDO_SELECTION_HISTORY_ENABLED); + _subEditView.execute(SCI_SETUNDOSELECTIONHISTORY, SC_UNDO_SELECTION_HISTORY_ENABLED); + const auto& hf = _mainDocTab.getFont(nppGUI._tabStatus & TAB_REDUCE); if (hf) {