diff options
Diffstat (limited to '')
| -rw-r--r-- | source/library/components/Editor.svelte | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/library/components/Editor.svelte b/source/library/components/Editor.svelte index 393812a..073a76a 100644 --- a/source/library/components/Editor.svelte +++ b/source/library/components/Editor.svelte @@ -115,6 +115,18 @@ // Invalid SDL — silently skip; editor keeps working without schema awareness } }); + + $effect(() => { + if (!view) + return; + + if (view.state.doc.toString() === value) + return; + + view.dispatch({ + changes: { from: 0, insert: value, to: view.state.doc.length } + }); + }); </script> <style lang="scss"> |