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

Rename 'lineNumber' to 'displayLineNumbers'

This commit is contained in:
David Pavlík
2017-12-23 22:51:38 +01:00
parent 7a4258bb20
commit 1f5f6c3b0e
5 changed files with 9 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ export default class CodeEditor extends React.Component {
this.value = this.props.value
this.editor = CodeMirror(this.refs.root, {
value: this.props.value,
lineNumbers: this.props.lineNumber,
lineNumbers: this.props.displayLineNumbers,
lineWrapping: true,
theme: this.props.theme,
indentUnit: this.props.indentSize,
@@ -141,8 +141,8 @@ export default class CodeEditor extends React.Component {
this.editor.setOption('indentWithTabs', this.props.indentType !== 'space')
}
if (prevProps.lineNumber !== this.props.lineNumber) {
this.editor.setOption('lineNumbers', this.props.lineNumber)
if (prevProps.displayLineNumbers !== this.props.displayLineNumbers) {
this.editor.setOption('lineNumbers', this.props.displayLineNumbers)
}
if (needRefresh) {

View File

@@ -213,8 +213,6 @@ class MarkdownEditor extends React.Component {
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
let editorIndentSize = parseInt(config.editor.indentSize, 10)
if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4
let editorLineNumber = config.editor.lineNumber
if (editorLineNumber === undefined) editorLineNumber = true
let previewStyle = {}
if (this.props.ignorePreviewPointerEvents) previewStyle.pointerEvents = 'none'
@@ -244,7 +242,7 @@ class MarkdownEditor extends React.Component {
fontSize={editorFontSize}
indentType={config.editor.indentType}
indentSize={editorIndentSize}
lineNumber={editorLineNumber}
displayLineNumbers={config.editor.displayLineNumbers}
storageKey={storageKey}
onChange={(e) => this.handleChange(e)}
onBlur={(e) => this.handleBlur(e)}

View File

@@ -530,7 +530,7 @@ class SnippetNoteDetail extends React.Component {
fontSize={editorFontSize}
indentType={config.editor.indentType}
indentSize={editorIndentSize}
lineNumber
displayLineNumbers
keyMap={config.editor.keyMap}
onChange={(e) => this.handleCodeChange(index)(e)}
ref={'code-' + index}

View File

@@ -35,7 +35,7 @@ export const DEFAULT_CONFIG = {
fontFamily: win ? 'Segoe UI' : 'Monaco, Consolas',
indentType: 'space',
indentSize: '2',
lineNumber: true,
displayLineNumbers: true,
switchPreview: 'BLUR' // Available value: RIGHTCLICK, BLUR
},
preview: {

View File

@@ -46,7 +46,7 @@ class UiTab extends React.Component {
fontFamily: this.refs.editorFontFamily.value,
indentType: this.refs.editorIndentType.value,
indentSize: this.refs.editorIndentSize.value,
lineNumber: this.refs.editorLineNumber.checked,
displayLineNumbers: this.refs.editorDisplayLineNumbers.checked,
switchPreview: this.refs.editorSwitchPreview.value,
keyMap: this.refs.editorKeyMap.value
},
@@ -226,8 +226,8 @@ class UiTab extends React.Component {
<div styleName='group-checkBoxSection'>
<label>
<input onChange={(e) => this.handleUIChange(e)}
checked={this.state.config.editor.lineNumber}
ref='editorLineNumber'
checked={this.state.config.editor.displayLineNumbers}
ref='editorDisplayLineNumbers'
type='checkbox'
/>&nbsp;
Show line numbers in the editor