scroll to center

This commit is contained in:
Jade (Rose) Rowland
2026-01-22 02:04:27 -05:00
parent 76cbd23859
commit 3c5afb32f3
+5 -1
View File
@@ -1,5 +1,6 @@
import { EditorSelection } from '@codemirror/state';
import { SearchCursor } from '@codemirror/search';
import { EditorView } from '@codemirror/view';
const COMMENT_STRING = '//';
@@ -49,7 +50,10 @@ export function jumpToCharacter(view, character, num) {
const selection = EditorSelection.cursor(pos - 1);
dispatch({
selection,
scrollIntoView: true,
effects: EditorView.scrollIntoView(
selection.head,
{y: "center"}
)
});
return true;
}