Minor code improvement

pull/14003/head
Don Ho 2023-08-13 18:00:28 +02:00
parent 460b2b60f6
commit a81d39fa6e
1 changed files with 5 additions and 6 deletions

View File

@ -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.