Skip to content

Commit

Permalink
propagate prefs to codemirrors. fixes chinchang#307
Browse files Browse the repository at this point in the history
  • Loading branch information
chinchang committed Jun 25, 2018
1 parent a126338 commit 4163b6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/ContentWrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export default class ContentWrap extends Component {
this.state.codeSplitSizes !== nextState.codeSplitSizes ||
this.state.mainSplitSizes !== nextState.mainSplitSizes ||
this.props.currentLayoutMode !== nextProps.currentLayoutMode ||
this.props.currentItem !== nextProps.currentItem
this.props.currentItem !== nextProps.currentItem ||
this.props.prefs !== nextProps.prefs
);
}
componentDidUpdate() {
Expand Down Expand Up @@ -748,6 +749,7 @@ export default class ContentWrap extends Component {
matchTags: { bothTags: true },
emmet: true
}}
prefs={this.props.prefs}
onChange={this.onHtmlCodeChange.bind(this)}
onCreation={el => (this.cm.html = el)}
onFocus={this.editorFocusHandler.bind(this)}
Expand Down Expand Up @@ -813,6 +815,7 @@ export default class ContentWrap extends Component {
],
emmet: true
}}
prefs={this.props.prefs}
onChange={this.onCssCodeChange.bind(this)}
onCreation={el => (this.cm.css = el)}
onFocus={this.editorFocusHandler.bind(this)}
Expand Down Expand Up @@ -864,6 +867,7 @@ export default class ContentWrap extends Component {
'CodeMirror-foldgutter'
]
}}
prefs={this.props.prefs}
autoComplete={this.props.prefs.autoComplete}
onChange={this.onJsCodeChange.bind(this)}
onCreation={el => (this.cm.js = el)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserCodeMirror.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class UserCodeMirror extends Component {
if (!options.noAutocomplete) {
this.cm.on('inputRead', (editor, input) => {
if (
!this.props.autoComplete ||
!this.props.prefs.autoComplete ||
input.origin !== '+input' ||
input.text[0] === ';' ||
input.text[0] === ',' ||
Expand Down

0 comments on commit 4163b6c

Please sign in to comment.