From 7057fba3ab4d9f0be4cd6dbbf9bdafe170dd229b Mon Sep 17 00:00:00 2001 From: seonim-ryu Date: Tue, 14 Jul 2020 11:27:58 +0900 Subject: [PATCH] refactor: change variable name --- apps/editor/src/js/markdownEditor.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/editor/src/js/markdownEditor.js b/apps/editor/src/js/markdownEditor.js index c698863120..d80785f559 100644 --- a/apps/editor/src/js/markdownEditor.js +++ b/apps/editor/src/js/markdownEditor.js @@ -391,9 +391,9 @@ class MarkdownEditor extends CodeMirrorExt { } _changeTextToTaskMarker() { - const { line: curLine, ch: curCh } = this.cm.getCursor(); - const mdCh = this.cm.getLine(curLine).length === curCh ? curCh : curCh + 1; - const mdNode = this.toastMark.findNodeAtPosition([curLine + 1, mdCh]); + const { line, ch } = this.cm.getCursor(); + const mdCh = this.cm.getLine(line).length === ch ? ch : ch + 1; + const mdNode = this.toastMark.findNodeAtPosition([line + 1, mdCh]); const paraNode = findClosestNode( mdNode, node => node.type === 'paragraph' && node.parent && node.parent.type === 'item' @@ -401,13 +401,13 @@ class MarkdownEditor extends CodeMirrorExt { if (paraNode && paraNode.firstChild) { const { literal, sourcepos } = paraNode.firstChild; - const [[line, ch]] = sourcepos; + const [[startLine, startCh]] = sourcepos; const matched = literal.match(TASK_MARKER_RX); if (matched) { const [, startSpaces, stateChar, lastSpaces] = matched; const spaces = startSpaces.length + lastSpaces.length; - const startPos = { line: line - 1, ch }; + const startPos = { line: startLine - 1, ch: startCh }; if (stateChar) { this.cm.replaceRange(stateChar, startPos, addChPos(startPos, spaces ? spaces + 1 : 0));