Skip to content

Commit 917591f

Browse files
authored
Merge pull request #3091 from Chaitanya1672/fixes-#2221/random-character-getting-deleted
fixes #2221 characters getting deleted between file changes
2 parents c1b3f7c + c5ffc8b commit 917591f

File tree

1 file changed

+10
-0
lines changed
  • client/modules/IDE/components/Editor

1 file changed

+10
-0
lines changed

client/modules/IDE/components/Editor/index.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,16 @@ class Editor extends React.Component {
239239

240240
componentDidUpdate(prevProps) {
241241
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+
}
242252
const oldDoc = this._cm.swapDoc(this._docs[this.props.file.id]);
243253
this._docs[prevProps.file.id] = oldDoc;
244254
this._cm.focus();

0 commit comments

Comments
 (0)