mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
Fix undo "Insert Date/Time" needs 2 times to get old data back issue
Fix #12831
This commit is contained in:
parent
535bd8fa0e
commit
04f38a7af0
@ -95,9 +95,12 @@ void Notepad_plus::command(int id)
|
||||
dateTimeStr += TEXT(" ");
|
||||
dateTimeStr += dateStr;
|
||||
}
|
||||
_pEditView->execute(SCI_BEGINUNDOACTION);
|
||||
|
||||
_pEditView->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
|
||||
_pEditView->addGenericText(dateTimeStr.c_str());
|
||||
|
||||
_pEditView->execute(SCI_ENDUNDOACTION);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -109,8 +112,12 @@ void Notepad_plus::command(int id)
|
||||
NppGUI& nppGUI = NppParameters::getInstance().getNppGUI();
|
||||
generic_string dateTimeStr = getDateTimeStrFrom(nppGUI._dateTimeFormat, currentTime);
|
||||
|
||||
_pEditView->execute(SCI_BEGINUNDOACTION);
|
||||
|
||||
_pEditView->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
|
||||
_pEditView->addGenericText(dateTimeStr.c_str());
|
||||
|
||||
_pEditView->execute(SCI_ENDUNDOACTION);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user