Skip to content

Commit 7edd349

Browse files
authored
Merge pull request #301 from insou22/xavc/fix-undo
mipsy_web: fix undo/redo
2 parents f636aad + e7c4090 commit 7edd349

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/mipsy_web/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@
131131
}
132132

133133
function set_editor_value(value="") {
134-
window.editor.setValue(value);
134+
// Don't unnecesarily call editor.setValue(),
135+
// since setValue will also reset undo history.
136+
if (get_editor_value() !== value) {
137+
window.editor.setValue(value);
138+
}
135139
}
136140

137141
function get_editor_value() {

0 commit comments

Comments
 (0)