fix(code): syntax highlighting not working in read-only code

This commit is contained in:
Elian Doran 2025-05-11 18:37:53 +03:00
parent b1f08b944a
commit c24e1f0ec5
No known key found for this signature in database
2 changed files with 1 additions and 1 deletions

View File

@ -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();
}

View File

@ -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) {