Browse Source

134164 change name to endLine

soumaeda 2 years ago
parent
commit
8815d2d0ed

+ 2 - 2
packages/editor/src/services/codemirror-editor/use-codemirror-editor/utils/insert-prefix.ts

@@ -23,8 +23,8 @@ export const useInsertPrefix = (view?: EditorView): InsertPrefix => {
     }
     }
     view.dispatch({ changes: lines });
     view.dispatch({ changes: lines });
     // get view state after insert
     // get view state after insert
-    const getEndLine = view.state.doc.lineAt(view.state.selection.main.to);
-    view.dispatch({ selection: { anchor: getEndLine.from + getEndLine.text.length } });
+    const endLine = view.state.doc.lineAt(view.state.selection.main.to);
+    view.dispatch({ selection: { anchor: endLine.from + endLine.text.length } });
     view.focus();
     view.focus();
   }, [view]);
   }, [view]);
 };
 };