fix lock
This commit is contained in:
1 parent
95c0b409b9
commit
9dba69e8da
2 files changed
+15
-8
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user