What is the proper way of setting a Monaco editors text content, without worrying about the undo stack? monacoEditor.setValue("text")
seems to crash somewhere deep inside:
vue.esm.js?efeb:1741 TypeError: (intermediate value)(intermediate value)(intermediate value).create is not a function
at D (textModel.ts:90)
at f.setValue (textModel.ts:385)
at t.setValue (commonCodeEditor.ts:211)
at VueComponent.loadFile (ResourceViewer.vue?d447:85)
For the future traveler from google, the following code works for 0.2.0, after you have initialized the editor:
editor.getModel().setValue('some value');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With