1
0
Fork 0
mirror of synced 2024-06-29 19:41:03 +12:00

Fixing code mirror mode reactivity.

This commit is contained in:
mike12345567 2021-12-14 10:45:38 +00:00
parent 8d6dc14608
commit 187ca44884

View file

@ -17,6 +17,7 @@
},
Text: {
name: "text/html",
json: false,
},
}
</script>
@ -40,11 +41,12 @@
let editor
// Keep editor up to date with value
$: editor?.setOption("mode", mode)
$: editor?.setValue(value || "")
// Creates an instance of a code mirror editor
async function createEditor(mode, value) {
if (!CodeMirror || !textarea || editor) {
if (!CodeMirror || !textarea) {
return
}