We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c1b3f7c + c5ffc8b commit 917591fCopy full SHA for 917591f
client/modules/IDE/components/Editor/index.jsx
@@ -239,6 +239,16 @@ class Editor extends React.Component {
239
240
componentDidUpdate(prevProps) {
241
if (this.props.file.id !== prevProps.file.id) {
242
+ const fileMode = this.getFileMode(this.props.file.name);
243
+ if (fileMode === 'javascript') {
244
+ // Define the new Emmet configuration based on the file mode
245
+ const emmetConfig = {
246
+ preview: ['html'],
247
+ markTagPairs: false,
248
+ autoRenameTags: true
249
+ };
250
+ this._cm.setOption('emmet', emmetConfig);
251
+ }
252
const oldDoc = this._cm.swapDoc(this._docs[this.props.file.id]);
253
this._docs[prevProps.file.id] = oldDoc;
254
this._cm.focus();
0 commit comments