From c24e1f0ec50e1a5d2c48351448a9a730c6a44edf Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 11 May 2025 18:37:53 +0300 Subject: [PATCH] fix(code): syntax highlighting not working in read-only code --- .../client/src/widgets/type_widgets/abstract_code_type_widget.ts | 1 + apps/client/src/widgets/type_widgets/editable_code.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) 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) {