diff --git a/client/modules/IDE/components/Editor/index.jsx b/client/modules/IDE/components/Editor/index.jsx index 609f31a504..6f5eeb5609 100644 --- a/client/modules/IDE/components/Editor/index.jsx +++ b/client/modules/IDE/components/Editor/index.jsx @@ -239,6 +239,16 @@ class Editor extends React.Component { componentDidUpdate(prevProps) { if (this.props.file.id !== prevProps.file.id) { + const fileMode = this.getFileMode(this.props.file.name); + if (fileMode === 'javascript') { + // Define the new Emmet configuration based on the file mode + const emmetConfig = { + preview: ['html'], + markTagPairs: false, + autoRenameTags: true + }; + this._cm.setOption('emmet', emmetConfig); + } const oldDoc = this._cm.swapDoc(this._docs[this.props.file.id]); this._docs[prevProps.file.id] = oldDoc; this._cm.focus();