From a81d39fa6ecbaccfbc20b837116352c6d3ec25b5 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 13 Aug 2023 18:00:28 +0200 Subject: [PATCH] Minor code improvement --- PowerEditor/src/Notepad_plus.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index c471c8cad..93cb43b53 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -8759,14 +8759,13 @@ void Notepad_plus::clearChangesHistory() Sci_Position pos = (Sci_Position)::SendMessage(_pEditView->getHSelf(), SCI_GETCURRENTPOS, 0, 0); int chFlags = (int)::SendMessage(_pEditView->getHSelf(), SCI_GETCHANGEHISTORY, 0, 0); - SendMessage(_pEditView->getHSelf(), SCI_EMPTYUNDOBUFFER, 0, 0); - SendMessage(_pEditView->getHSelf(), SCI_SETCHANGEHISTORY, SC_CHANGE_HISTORY_DISABLED, 0); - - SendMessage(_pEditView->getHSelf(), SCI_SETCHANGEHISTORY, chFlags, 0); - SendMessage(_pEditView->getHSelf(), SCI_GOTOPOS, pos, 0); + _pEditView->execute(SCI_EMPTYUNDOBUFFER); + _pEditView->execute(SCI_SETCHANGEHISTORY, SC_CHANGE_HISTORY_DISABLED); + _pEditView->execute(SCI_SETCHANGEHISTORY, chFlags); + _pEditView->execute(SCI_GOTOPOS, pos); checkUndoState(); - _pNonEditView->redraw(); + _pNonEditView->redraw(); // Prevent clonned document visual glichy on another view } // Based on https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12248#issuecomment-1258561261.