@@ -270,7 +270,7 @@ export const useMarkdownGrammer = ({
270270 editorCRDT . currentBlock = targetBlock ;
271271 setCaretPosition ( {
272272 blockId : targetBlock . id ,
273- linkedList : editorCRDT . LinkedList ,
273+
274274 position : targetBlock . crdt . read ( ) . length ,
275275 pageId,
276276 } ) ;
@@ -437,7 +437,7 @@ export const useMarkdownGrammer = ({
437437 currentBlock . crdt . currentCaret = e . key === "Home" ? 0 : currentBlock . crdt . read ( ) . length ;
438438 setCaretPosition ( {
439439 blockId : currentBlock . id ,
440- linkedList : editorCRDT . LinkedList ,
440+
441441 position : currentBlock . crdt . currentCaret ,
442442 pageId,
443443 } ) ;
@@ -456,7 +456,7 @@ export const useMarkdownGrammer = ({
456456 editorCRDT . currentBlock = headBlock ;
457457 setCaretPosition ( {
458458 blockId : headBlock . id ,
459- linkedList : editorCRDT . LinkedList ,
459+
460460 position : currentCaretPosition ,
461461 pageId,
462462 } ) ;
@@ -478,7 +478,7 @@ export const useMarkdownGrammer = ({
478478 editorCRDT . currentBlock = lastBlock ;
479479 setCaretPosition ( {
480480 blockId : lastBlock . id ,
481- linkedList : editorCRDT . LinkedList ,
481+
482482 position : currentCaretPosition ,
483483 pageId,
484484 } ) ;
@@ -516,7 +516,7 @@ export const useMarkdownGrammer = ({
516516 editorCRDT . currentBlock = targetBlock ;
517517 setCaretPosition ( {
518518 blockId : targetBlock . id ,
519- linkedList : editorCRDT . LinkedList ,
519+
520520 position : Math . min ( caretPosition , targetBlock . crdt . read ( ) . length ) ,
521521 pageId,
522522 } ) ;
@@ -547,7 +547,7 @@ export const useMarkdownGrammer = ({
547547 editorCRDT . currentBlock = targetBlock ;
548548 setCaretPosition ( {
549549 blockId : targetBlock . id ,
550- linkedList : editorCRDT . LinkedList ,
550+
551551 position : targetBlock . crdt . read ( ) . length ,
552552 pageId,
553553 } ) ;
@@ -573,7 +573,7 @@ export const useMarkdownGrammer = ({
573573 editorCRDT . currentBlock = targetBlock ;
574574 setCaretPosition ( {
575575 blockId : targetBlock . id ,
576- linkedList : editorCRDT . LinkedList ,
576+
577577 position : 0 ,
578578 pageId,
579579 } ) ;
0 commit comments