1
0
mirror of https://github.com/BoostIo/Boostnote synced 2026-01-30 09:07:21 +00:00

Make line numbers in the editor optional

This commit is contained in:
David Pavlík
2017-09-20 22:33:51 +02:00
parent 0d34a03fe0
commit 7a4258bb20
5 changed files with 22 additions and 1 deletions

View File

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

View File

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

View File

@@ -46,6 +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,
switchPreview: this.refs.editorSwitchPreview.value,
keyMap: this.refs.editorKeyMap.value
},
@@ -222,6 +223,17 @@ class UiTab extends React.Component {
</div>
</div>
<div styleName='group-checkBoxSection'>
<label>
<input onChange={(e) => this.handleUIChange(e)}
checked={this.state.config.editor.lineNumber}
ref='editorLineNumber'
type='checkbox'
/>&nbsp;
Show line numbers in the editor
</label>
</div>
<div styleName='group-header2'>Preview</div>
<div styleName='group-section'>
<div styleName='group-section-label'>