fix(editor): center search matches in the viewport

This commit is contained in:
Melody Ruch authored and GitHub committed 2026-08-12 19:26:24 +08:00
1 parent 2a26ea5429
commit b8d37774fd
2 files changed
+9 -2

No files matched your search

@@ -4679,6 +4679,10 @@ onMounted(async () => {
dom.style.display = "none";
return { dom };
},
// Center the match instead of the default "nearest" alignment, which
// often lands the match flush against the viewport edge and makes an
// immediate drag-select there trigger CodeMirror's edge autoscroll.
scrollToMatch: (range) => EditorView.scrollIntoView(range, { y: "center" }),
}),
runGutterComp.of(runStatementGutterExtension()),
lineNumbers({