mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
Change an arg name md to mdElement
This commit is contained in:
@@ -179,19 +179,19 @@ class MarkdownEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addMdAndMoveCaretToCenter (md) {
|
addMdAndMoveCaretToCenter (mdElement) {
|
||||||
const currentCaret = this.refs.code.editor.getCursor()
|
const currentCaret = this.refs.code.editor.getCursor()
|
||||||
const cmDoc = this.refs.code.editor.getDoc()
|
const cmDoc = this.refs.code.editor.getDoc()
|
||||||
cmDoc.replaceRange(md, currentCaret)
|
cmDoc.replaceRange(mdElement, currentCaret)
|
||||||
this.refs.code.editor.setCursor({line: currentCaret.line, ch: currentCaret.ch + md.length/2})
|
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 currentCaret = this.refs.code.editor.getCursor()
|
||||||
const word = this.refs.code.editor.findWordAt(currentCaret)
|
const word = this.refs.code.editor.findWordAt(currentCaret)
|
||||||
const cmDoc = this.refs.code.editor.getDoc()
|
const cmDoc = this.refs.code.editor.getDoc()
|
||||||
cmDoc.replaceRange(md, word.anchor)
|
cmDoc.replaceRange(mdElement, word.anchor)
|
||||||
cmDoc.replaceRange(md, { line: word.head.line, ch: word.head.ch + md.length })
|
cmDoc.replaceRange(mdElement, { line: word.head.line, ch: word.head.ch + mdElement.length })
|
||||||
}
|
}
|
||||||
|
|
||||||
handleKeyUp (e) {
|
handleKeyUp (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user