Perhaps there was a spelling mistake. originalModel should be modifiedModel?
Here's another counter-intuitive feature: when the language changes the entire editor is reset, including the content.
MonacoDiffEditor can be editable. And it provides no interface to text changes, so changes to its internal text are not perceptible, and a reset will clear all its internal state.
So I think the current content should be copied out and put into new Model.
Source:
src/runtime/MonacoDiffEditor.client.vue#L55
Perhaps there was a spelling mistake.
originalModel
should bemodifiedModel
?Here's another counter-intuitive feature: when the language changes the entire editor is reset, including the content.
MonacoDiffEditor
can be editable. And it provides no interface to text changes, so changes to its internal text are not perceptible, and a reset will clear all its internal state.So I think the current content should be copied out and put into new
Model
.Just like this: