1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Fix but: line numbers of editor isnt applied properly

This commit is contained in:
Junyoung Choi
2018-02-03 15:02:26 +09:00
parent 7cad3d403b
commit 69601bf15a
2 changed files with 4 additions and 2 deletions

View File

@@ -51,6 +51,7 @@ export default class CodeEditor extends React.Component {
componentDidMount () { componentDidMount () {
this.value = this.props.value this.value = this.props.value
this.editor = CodeMirror(this.refs.root, { this.editor = CodeMirror(this.refs.root, {
value: this.props.value, value: this.props.value,
lineNumbers: this.props.displayLineNumbers, lineNumbers: this.props.displayLineNumbers,
@@ -71,7 +72,7 @@ export default class CodeEditor extends React.Component {
if (cm.somethingSelected()) cm.indentSelection('add') if (cm.somethingSelected()) cm.indentSelection('add')
else { else {
const tabs = cm.getOption('indentWithTabs') const tabs = cm.getOption('indentWithTabs')
if (line.trimLeft().match(/^(-|\*|\+) (\[( |x)\] )?$/)) { if (line.trimLeft().match(/^(-|\*|\+) (\[( |x)] )?$/)) {
cm.execCommand('goLineStart') cm.execCommand('goLineStart')
if (tabs) { if (tabs) {
cm.execCommand('insertTab') cm.execCommand('insertTab')
@@ -234,7 +235,7 @@ export default class CodeEditor extends React.Component {
if (!dataTransferItem.type.match('image')) return if (!dataTransferItem.type.match('image')) return
const blob = dataTransferItem.getAsFile() const blob = dataTransferItem.getAsFile()
const reader = new FileReader() const reader = new window.FileReader()
let base64data let base64data
reader.readAsDataURL(blob) reader.readAsDataURL(blob)

View File

@@ -62,6 +62,7 @@ class MarkdownSplitEditor extends React.Component {
keyMap={config.editor.keyMap} keyMap={config.editor.keyMap}
fontFamily={config.editor.fontFamily} fontFamily={config.editor.fontFamily}
fontSize={editorFontSize} fontSize={editorFontSize}
displayLineNumbers={config.editor.displayLineNumbers}
indentType={config.editor.indentType} indentType={config.editor.indentType}
indentSize={editorIndentSize} indentSize={editorIndentSize}
scrollPastEnd={config.editor.scrollPastEnd} scrollPastEnd={config.editor.scrollPastEnd}