0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-05-07 18:48:39 +00:00
This commit is contained in:
Víctor Losada Hernández
2026-04-13 01:29:14 +02:00
parent 95c0b409b9
commit 9dba69e8da
2 changed files with 15 additions and 8 deletions
+4 -3
View File
@@ -367,12 +367,13 @@ const CodeEditor = forwardRef(
const pos = pageBreaksRef.current[pageNumber - 1] ?? 0;
return pos;
},
setCursorToLine : (lineNumber)=>{
setCursorToPage : (pageNumber)=>{
const view = viewRef.current;
const line = view.state.doc.line(lineNumber);
if(!view) return 0;
const pos = pageBreaksRef.current[pageNumber - 1] ?? 0;
view.dispatch({
selection : { anchor: line.from }
selection : { anchor: pos }
});
view.focus();