fix: #1753 Undo in Monaco
This commit is contained in:
@@ -170,7 +170,14 @@
|
|||||||
const newText = editorMode === 'code' ? code : mermaid;
|
const newText = editorMode === 'code' ? code : mermaid;
|
||||||
if (newText !== currentText) {
|
if (newText !== currentText) {
|
||||||
editor.setScrollTop(0);
|
editor.setScrollTop(0);
|
||||||
editor.setValue(newText);
|
editor.pushUndoStop();
|
||||||
|
editor.executeEdits('updateCode', [
|
||||||
|
{
|
||||||
|
range: model.getFullModelRange(),
|
||||||
|
text: newText
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
editor.pushUndoStop();
|
||||||
currentText = newText;
|
currentText = newText;
|
||||||
renderAIPromptGutterGlyphIcon();
|
renderAIPromptGutterGlyphIcon();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user