File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ export default {
186
186
if (editor != null && editor .getModifiedEditor != null ) {
187
187
return editor .getModifiedEditor ()
188
188
}
189
- return editor
189
+ return null
190
190
},
191
191
},
192
192
@@ -241,16 +241,17 @@ export default {
241
241
},
242
242
243
243
createEditor () {
244
- const editor = monaco .editor .create (
245
- this .$el ,
246
- Object .assign ({ value: this .code , language: " html" }, EDITOR_OPTS )
247
- )
244
+ const editor = monaco .editor .create (this .$el , EDITOR_OPTS )
245
+ const model = monaco .editor .createModel (this .code , " html" )
248
246
249
247
// Set change event.
250
- editor . getModel () .onDidChangeContent (() => {
248
+ model .onDidChangeContent (() => {
251
249
this .invalidate ()
252
250
})
253
251
252
+ // Set model.
253
+ editor .setModel (model)
254
+
254
255
// Set markers.
255
256
updateMarkers (editor, this .messages )
256
257
You can’t perform that action at this time.
0 commit comments