Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mipsy_web: fix undo/redo #301

Merged
merged 1 commit into from
May 26, 2024
Merged

mipsy_web: fix undo/redo #301

merged 1 commit into from
May 26, 2024

Conversation

XavierCooney
Copy link
Collaborator

Calling setValue on the editor causes it to drop the current undo/redo history, and set_editor_value is called whenever the user changes the source code. This resulted in undo/redo not working at all. This commit changes set_editor_value to only call setValue when there's a difference between the new and old value.

There's likely a nicer way of fixing this that involves set_editor_value not being called as often -- but this change seemed least likely to introduce a bug related to a desync between the editor's and the app's view of the editor contents.

Calling setValue on the editor causes it to drop the current
undo/redo history, and set_editor_value() is called whenever
the user changes the source code. This resulted in undo/redo
not working at all. This commit changes set_editor_value to
only call setValue() when there's a difference between the
new and old value.

There's likely a nicer way of fixing this that involves
set_editor_value() not being called as often -- but this
change seemed least likely to introduce a bug related to
a desync between the editor's and the app's view of the
editor contents.
@abiramen abiramen self-requested a review May 26, 2024 12:15
@XavierCooney XavierCooney merged commit 7edd349 into main May 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants