Explorar o código

use firstLine as method

soumaeda %!s(int64=2) %!d(string=hai) anos
pai
achega
d4b48300e0
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      apps/app/src/components/PageEditor/MarkdownDrawioUtil.js

+ 4 - 4
apps/app/src/components/PageEditor/MarkdownDrawioUtil.js

@@ -47,7 +47,7 @@ class MarkdownDrawioUtil {
 
 
     let line = this.doc(editor).lineAt(this.curPos(editor)).number - 1;
     let line = this.doc(editor).lineAt(this.curPos(editor)).number - 1;
     let isFound = false;
     let isFound = false;
-    for (; line >= this.firstLine; line--) {
+    for (; line >= this.firstLine(); line--) {
       const strLine = this.getLine(editor, line).text;
       const strLine = this.getLine(editor, line).text;
       if (this.lineBeginPartOfDrawioRE.test(strLine)) {
       if (this.lineBeginPartOfDrawioRE.test(strLine)) {
         isFound = true;
         isFound = true;
@@ -64,8 +64,8 @@ class MarkdownDrawioUtil {
       return null;
       return null;
     }
     }
 
 
-    const botLine = Math.max(this.firstLine, line);
-    return this.getLineText(editor, botLine).from;
+    const botLine = Math.max(this.firstLine(), line);
+    return this.getLine(editor, botLine).from;
   }
   }
 
 
   /**
   /**
@@ -189,7 +189,7 @@ class MarkdownDrawioUtil {
   findAllDrawioSection(editor) {
   findAllDrawioSection(editor) {
     const lineNumbers = [];
     const lineNumbers = [];
     const lastLine = this.lastLine(editor);
     const lastLine = this.lastLine(editor);
-    let firstLine = this.firstLine;
+    let firstLine = this.firstLine();
     // refs: https://github.com/codemirror/CodeMirror/blob/5.64.0/addon/fold/foldcode.js#L106-L111
     // refs: https://github.com/codemirror/CodeMirror/blob/5.64.0/addon/fold/foldcode.js#L106-L111
     for (firstLine, lastLine; firstLine <= lastLine; firstLine++) {
     for (firstLine, lastLine; firstLine <= lastLine; firstLine++) {
       const lineText = this.getLine(editor, firstLine + 1).text;
       const lineText = this.getLine(editor, firstLine + 1).text;