diff --git a/apps/client/src/widgets/type_widgets/abstract_code_type_widget.ts b/apps/client/src/widgets/type_widgets/abstract_code_type_widget.ts index e76901577..6dd68139a 100644 --- a/apps/client/src/widgets/type_widgets/abstract_code_type_widget.ts +++ b/apps/client/src/widgets/type_widgets/abstract_code_type_widget.ts @@ -61,6 +61,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget { */ _update(note: FNote, content: string) { this.codeEditor.setText(content); + this.codeEditor.setMimeType(note.mime); this.codeEditor.clearHistory(); } diff --git a/apps/client/src/widgets/type_widgets/editable_code.ts b/apps/client/src/widgets/type_widgets/editable_code.ts index 339caada8..b60e8e422 100644 --- a/apps/client/src/widgets/type_widgets/editable_code.ts +++ b/apps/client/src/widgets/type_widgets/editable_code.ts @@ -66,7 +66,6 @@ export default class EditableCodeTypeWidget extends AbstractCodeTypeWidget { this._update(note, blob?.content ?? ""); }); - this.codeEditor.setMimeType(note.mime); this.show(); if (this.parent && hasTouchBar) {