diff --git a/src/lib/elements/AE_Comp_Editor_CodeMirror.svelte b/src/lib/elements/AE_Comp_Editor_CodeMirror.svelte
index b81f3aad..2bd6e7a1 100644
--- a/src/lib/elements/AE_Comp_Editor_CodeMirror.svelte
+++ b/src/lib/elements/AE_Comp_Editor_CodeMirror.svelte
@@ -29,7 +29,7 @@
let {
content = $bindable(''),
- new_content = $bindable(''),
+ new_content = $bindable(),
placeholder = 'Start typing...',
theme_mode = 'light',
language = 'markdown',
@@ -46,7 +46,7 @@
async function create_editor() {
if (!browser) return;
-
+
cm = await ensureCodeMirrorModules();
if (!cm) return;
@@ -70,7 +70,7 @@
cm.crosshairCursor(),
cm.highlightActiveLine(),
cm.highlightActiveLineGutter(),
-
+
// Keymaps
cm.keymap.of([
...cm.defaultKeymap,
@@ -178,14 +178,14 @@
const changes = state.changeByRange((range: any) => {
const line = state.doc.lineAt(range.from);
const has_list = line.text.startsWith('- ');
-
+
if (has_list) {
return {
changes: [{ from: line.from, to: line.from + 2, insert: '' }],
range: cm.EditorSelection.range(range.from - 2, range.to - 2)
};
}
-
+
return {
changes: [{ from: line.from, insert: '- ' }],
range: cm.EditorSelection.range(range.from + 2, range.to + 2)
@@ -211,15 +211,15 @@
-
+