From 096f8a1f651538b2395a98cb123234ce813d08c3 Mon Sep 17 00:00:00 2001 From: cdr Date: Thu, 21 Mar 2019 20:52:56 -0400 Subject: [PATCH] Hardcode 2-space configuration in Editor.jsx --- client/modules/IDE/components/Editor.jsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index 485302e5..d756657d 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -137,9 +137,6 @@ class Editor extends React.Component { }); this._cm.getWrapperElement().style['font-size'] = `${this.props.fontSize}px`; - this._cm.setOption('indentWithTabs', this.props.isTabIndent); - this._cm.setOption('tabSize', this.props.indentationAmount); - this._cm.setOption('indentUnit', this.props.indentationAmount); this.props.provideController({ tidyCode: this.tidyCode, @@ -174,13 +171,6 @@ class Editor extends React.Component { if (this.props.fontSize !== prevProps.fontSize) { this._cm.getWrapperElement().style['font-size'] = `${this.props.fontSize}px`; } - if (this.props.indentationAmount !== prevProps.indentationAmount) { - this._cm.setOption('tabSize', this.props.indentationAmount); - this._cm.setOption('indentUnit', this.props.indentationAmount); - } - if (this.props.isTabIndent !== prevProps.isTabIndent) { - this._cm.setOption('indentWithTabs', this.props.isTabIndent); - } if (this.props.theme !== prevProps.theme) { this._cm.setOption('theme', `p5-${this.props.theme}`); } @@ -254,8 +244,8 @@ class Editor extends React.Component { tidyCode() { const beautifyOptions = { - indent_size: this.props.indentationAmount, - indent_with_tabs: this.props.isTabIndent + indent_size: 2, + indent_with_tabs: false }; const mode = this._cm.getOption('mode'); @@ -351,8 +341,6 @@ Editor.propTypes = { })), updateLintMessage: PropTypes.func.isRequired, clearLintMessage: PropTypes.func.isRequired, - indentationAmount: PropTypes.number.isRequired, - isTabIndent: PropTypes.bool.isRequired, updateFileContent: PropTypes.func.isRequired, fontSize: PropTypes.number.isRequired, file: PropTypes.shape({