Skip to content

Commit 4782b85

Browse files
authored
fix: inconsistent editor state for empty values (#520)
1 parent 8e94825 commit 4782b85

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/five-sloths-jam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/repl': patch
3+
---
4+
5+
fix: inconsistent editor state for empty values

packages/repl/src/lib/CodeMirror.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/** @type {import('./types').StartOrEnd | null} */
1616
export let errorLoc = null;
1717
18-
/** @type {import('@codemirror/lint').LintSource>} */
18+
/** @type {import('@codemirror/lint').LintSource} */
1919
export let diagnostics;
2020
2121
export let readonly = false;
@@ -52,7 +52,7 @@
5252
lang = options.lang;
5353
}
5454
55-
if (options.code) {
55+
if (options.code !== undefined) {
5656
updating_externally = true;
5757
5858
const { scrollLeft: left, scrollTop: top } = $cmInstance.view.scrollDOM;

0 commit comments

Comments
 (0)