@setoelkahfi / svara / commits / 1186806

forget line wrapping

mellobacon committed Aug 25, 2022 at 12:44 UTC 1186806ea0745ffc508ad582ddd6689620a02dd9
1 file changed +5 -5
src/components/Content/Editor/CodeMirrorEditor.svelte
+5 -5
@@ -16,20 +16,20 @@
16 onMount(() => {
17 editorView = new EditorView({
18 state: EditorState.create({
19 - extensions: [basicSetup, default_theme, keymap.of([indentWithTab]), EditorView.lineWrapping],
19 + extensions: [basicSetup, default_theme, keymap.of([indentWithTab])],
20 doc: content
21 }),
22 parent: editorElement,
23 });
24 });
25 </script>
26 -<div class="editor" class:hidden bind:this={editorElement} on:input={async () => {
26 +<div class="editor" class:hidden bind:this={editorElement} on:input={async (e) => {
27 await tick();
28 - let x = "";
28 + let filecontent = "";
29 for (let text of editorView.state.doc) {
30 - x += `${text} `;
30 + filecontent += `${text} `;
31 }
32 - dispatch("input", x);
32 + dispatch("input", filecontent);
33 }} />
34
35 <style>