Skip to content

Commit

Permalink
Merge pull request #301 from insou22/xavc/fix-undo
Browse files Browse the repository at this point in the history
mipsy_web: fix undo/redo
  • Loading branch information
XavierCooney authored May 26, 2024
2 parents f636aad + e7c4090 commit 7edd349
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/mipsy_web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@
}

function set_editor_value(value="") {
window.editor.setValue(value);
// Don't unnecesarily call editor.setValue(),
// since setValue will also reset undo history.
if (get_editor_value() !== value) {
window.editor.setValue(value);
}
}

function get_editor_value() {
Expand Down

0 comments on commit 7edd349

Please sign in to comment.