Просмотр исходного кода

receive lastline number directly

soumaeda 2 лет назад
Родитель
Сommit
4b810381cc
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      apps/app/src/components/PageEditor/MarkdownTableUtilForEditor.ts

+ 1 - 1
apps/app/src/components/PageEditor/MarkdownTableUtilForEditor.ts

@@ -53,7 +53,7 @@ export const getEot = (editor: EditorView): number => {
   }
 
   const doc = editor.state.doc;
-  const lastLineNum = doc.line(doc.lines).number;
+  const lastLineNum = doc.lines;
   let line = doc.lineAt(curPos(editor)).number + 1;
   for (; line <= lastLineNum; line++) {
     const strLine = doc.line(line).text;