fix: #1753 Undo in Monaco

This commit is contained in:
Sidharth Vinod
2026-06-08 18:14:56 +05:30
parent 6438d0074d
commit c62ebf6d09
+8 -1
View File
@@ -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();
} }