Skip to content

Conversation

mosquitochang
Copy link

This PR is to resolve issue #19.

The root cause is on the monaco-editor side, which is related to the incorrect event order of onDidChangeModelContent and onDidChangeCursorSelection on undo/redo. Please refer to microsoft/monaco-editor#2774 for more details.

  • Refactored some code into function _monacoSelectionChangeHandler
  • Added a workaround to make sure "selection changes" always happen after "content changes"

Before:

2024-01-30.4.11.36.mp4

After:

2024-01-30.4.13.00.mp4

Review PR in StackBlitz Submitted with StackBlitz.

kolovos added a commit to kolovos/y-monaco that referenced this pull request Feb 26, 2025
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.

1 participant