mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-24 06:14:47 +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 += TEXT(" ");
|
||||||
dateTimeStr += dateStr;
|
dateTimeStr += dateStr;
|
||||||
}
|
}
|
||||||
|
_pEditView->execute(SCI_BEGINUNDOACTION);
|
||||||
|
|
||||||
_pEditView->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
|
_pEditView->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
|
||||||
_pEditView->addGenericText(dateTimeStr.c_str());
|
_pEditView->addGenericText(dateTimeStr.c_str());
|
||||||
|
|
||||||
|
_pEditView->execute(SCI_ENDUNDOACTION);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -109,8 +112,12 @@ void Notepad_plus::command(int id)
|
|||||||
NppGUI& nppGUI = NppParameters::getInstance().getNppGUI();
|
NppGUI& nppGUI = NppParameters::getInstance().getNppGUI();
|
||||||
generic_string dateTimeStr = getDateTimeStrFrom(nppGUI._dateTimeFormat, currentTime);
|
generic_string dateTimeStr = getDateTimeStrFrom(nppGUI._dateTimeFormat, currentTime);
|
||||||
|
|
||||||
|
_pEditView->execute(SCI_BEGINUNDOACTION);
|
||||||
|
|
||||||
_pEditView->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
|
_pEditView->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
|
||||||
_pEditView->addGenericText(dateTimeStr.c_str());
|
_pEditView->addGenericText(dateTimeStr.c_str());
|
||||||
|
|
||||||
|
_pEditView->execute(SCI_ENDUNDOACTION);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user