File tree Expand file tree Collapse file tree 4 files changed +9
-36
lines changed
sites/svelte-5-preview/src/lib Expand file tree Collapse file tree 4 files changed +9
-36
lines changed Original file line number Diff line number Diff line change 1212 import Message from ' ./Message.svelte' ;
1313 import { svelteTheme } from ' ./theme.js' ;
1414
15- /** @type {import('./types').StartOrEnd | null} */
16- export let errorLoc = null ;
17-
1815 /** @type {import('@codemirror/lint').LintSource | undefined} */
1916 export let diagnostics = undefined ;
2017
171168
172169 let marked = false ;
173170
174- /** @type {number | null} */
175- let error_line = null ;
176-
177171 let updating_externally = false ;
178172
179173 /** @type {import('@codemirror/state').Extension[]} */
180174 let extensions = [];
181175
182176 let cursor_pos = 0 ;
183177
184- $: {
185- if ($cmInstance .view ) {
186- fulfil_module_editor_ready ();
187- }
178+ $: if ($cmInstance .view ) {
179+ fulfil_module_editor_ready ();
188180 }
189181
190182 $: if ($cmInstance .view && w && h) resize ();
191183
192- $: {
193- if (marked) {
194- unmarkText ();
195- marked = false ;
196- }
197-
198- if (errorLoc) {
199- markText ({ from: errorLoc .character , to: errorLoc .character + 1 , className: ' error-loc' });
200-
201- error_line = errorLoc .line ;
202- } else {
203- error_line = null ;
204- }
184+ $: if (marked) {
185+ unmarkText ();
186+ marked = false ;
205187 }
206188
207189 const watcher = EditorView .updateListener .of ((viewUpdate ) => {
Original file line number Diff line number Diff line change 33 import { get_full_filename } from ' $lib/utils.js' ;
44 import CodeMirror from ' ../CodeMirror.svelte' ;
55
6- /** @type {import('$lib/types').StartOrEnd | null} */
7- export let errorLoc = null ;
8-
96 /** @type {boolean} */
107 export let autocomplete;
118
5855 < div class = " editor notranslate" translate= " no" >
5956 < CodeMirror
6057 bind: this = {$module_editor}
61- {errorLoc}
6258 {autocomplete}
6359 diagnostics= {$selected && $bundle ? diagnostics : () => []}
6460 on: change= {handle_change}
Original file line number Diff line number Diff line change 1010 /** @type {string | null} */
1111 export let status;
1212
13- /** @type {import('$lib/types').StartOrEnd | null} */
14- export let sourceErrorLoc = null ;
15-
1613 /** @type {import('$lib/types').MessageDetails | null} */
1714 export let runtimeError = null ;
1815
9794<!-- js output -->
9895<div class ="tab-content" class:visible ={selected ?.type !== ' md' && view === ' js' }>
9996 {#if embedded }
100- <CodeMirror bind:this ={js_editor } errorLoc ={ sourceErrorLoc } readonly />
97+ <CodeMirror bind:this ={js_editor } readonly />
10198 {:else }
10299 <PaneWithPanel pos =" 50%" panel =" Compiler options" >
103100 <div slot =" main" >
104- <CodeMirror bind:this ={js_editor } errorLoc ={ sourceErrorLoc } readonly />
101+ <CodeMirror bind:this ={js_editor } readonly />
105102 </div >
106103
107104 <div slot =" panel-body" >
113110
114111<!-- css output -->
115112<div class ="tab-content" class:visible ={selected ?.type !== ' md' && view === ' css' }>
116- <CodeMirror bind:this ={css_editor } errorLoc ={ sourceErrorLoc } readonly />
113+ <CodeMirror bind:this ={css_editor } readonly />
117114</div >
118115
119116<!-- ast output -->
Original file line number Diff line number Diff line change 260260
261261 $: $toggleable = mobile && orientation === ' columns' ;
262262
263- /** @type {import('./types').StartOrEnd} */
264- let sourceErrorLoc;
265263 let width = 0 ;
266264 let show_output = false ;
267265
321319 >
322320 < section slot= " a" >
323321 < ComponentSelector show_modified= {showModified} on: add on: remove / >
324- < ModuleEditor errorLoc = {sourceErrorLoc} {autocomplete} / >
322+ < ModuleEditor {autocomplete} / >
325323 < / section>
326324
327325 < section slot= " b" style= " height: 100%;" >
You can’t perform that action at this time.
0 commit comments