From c8b97ffde3172a36892e43f72e9532a99428e556 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Sat, 30 Dec 2017 11:04:13 +0900 Subject: [PATCH] pass fontSize and indentSize to CodeEditor as props --- browser/components/MarkdownSplitEditor.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/browser/components/MarkdownSplitEditor.js b/browser/components/MarkdownSplitEditor.js index b77c0b6b..0ea41a44 100644 --- a/browser/components/MarkdownSplitEditor.js +++ b/browser/components/MarkdownSplitEditor.js @@ -45,6 +45,10 @@ class MarkdownSplitEditor extends React.Component { render () { const { config, value, storageKey } = this.props const storage = findStorage(storageKey) + let editorFontSize = parseInt(config.editor.fontSize, 10) + if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 + let editorIndentSize = parseInt(config.editor.indentSize, 10) + if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4 const previewStyle = {} if (this.props.ignorePreviewPointerEvents) previewStyle.pointerEvents = 'none' return ( @@ -57,7 +61,9 @@ class MarkdownSplitEditor extends React.Component { theme={config.editor.theme} keyMap={config.editor.keyMap} fontFamily={config.editor.fontFamily} + fontSize={editorFontSize} indentType={config.editor.indentType} + indentSize={editorIndentSize} scrollPastEnd={config.editor.scrollPastEnd} storageKey={storageKey} onChange={this.handleOnChange.bind(this)}