Skip to content

Commit

Permalink
Change an arg name md to mdElement
Browse files Browse the repository at this point in the history
  • Loading branch information
asmsuechan committed Mar 12, 2017
1 parent 49a4ec5 commit 48514d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions browser/components/MarkdownEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,19 @@ class MarkdownEditor extends React.Component {
}
}

addMdAndMoveCaretToCenter (md) {
addMdAndMoveCaretToCenter (mdElement) {
const currentCaret = this.refs.code.editor.getCursor()
const cmDoc = this.refs.code.editor.getDoc()
cmDoc.replaceRange(md, currentCaret)
this.refs.code.editor.setCursor({line: currentCaret.line, ch: currentCaret.ch + md.length/2})
cmDoc.replaceRange(mdElement, currentCaret)
this.refs.code.editor.setCursor({line: currentCaret.line, ch: currentCaret.ch + mdElement.length/2})
}

addMdBetweenWord (md) {
addMdBetweenWord (mdElement) {
const currentCaret = this.refs.code.editor.getCursor()
const word = this.refs.code.editor.findWordAt(currentCaret)
const cmDoc = this.refs.code.editor.getDoc()
cmDoc.replaceRange(md, word.anchor)
cmDoc.replaceRange(md, { line: word.head.line, ch: word.head.ch + md.length })
cmDoc.replaceRange(mdElement, word.anchor)
cmDoc.replaceRange(mdElement, { line: word.head.line, ch: word.head.ch + mdElement.length })
}

handleKeyUp (e) {
Expand Down

0 comments on commit 48514d1

Please sign in to comment.