-
-
- {lint.lint_kind} - “
- {spanContent(lint.span, content)}
- ”
-
-
-
-
{lint.message}
- {#each lint.suggestions as suggestion}
-
-
-
- {/each}
+
diff --git a/web/src/lib/Underlines.svelte b/web/src/lib/Underlines.svelte
index 3479c5ec6..070c07171 100644
--- a/web/src/lib/Underlines.svelte
+++ b/web/src/lib/Underlines.svelte
@@ -6,6 +6,7 @@
export let focusLintIndex: number | undefined;
let lints: [Lint, number][] = [];
+ let lintHighlights: HTMLSpanElement[] = [];
$: lintText(content).then(
(newLints) =>
@@ -13,6 +14,8 @@
.map<[Lint, number]>((lint, index) => [lint, index])
.toSorted(([a], [b]) => a.span.start - b.span.end))
);
+ $: if (focusLintIndex != null && lintHighlights[focusLintIndex] != null)
+ lintHighlights[focusLintIndex].scrollIntoView({ behavior: 'smooth' });
function reOrgString(text: string): (string | undefined)[] {
if (text.trim().length == 0) {
@@ -90,6 +93,7 @@
(focusLintIndex = chunk[3]) && console.log('hit')}
style={`--line-color: ${chunk[1]}; --line-width: ${chunk[2] ? '4px' : '2px'}; --bg-color: ${chunk[2] ? '#8DA9C4' : 'transparent'};`}
>