mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
refactor(code): use dedicated method for setting text
This commit is contained in:
@@ -56,13 +56,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
|
||||
* @param {*} content the new content of the note.
|
||||
*/
|
||||
_update(note: { mime: string }, content: string) {
|
||||
this.codeEditor.dispatch({
|
||||
changes: {
|
||||
from: 0,
|
||||
to: this.codeEditor.state.doc.length,
|
||||
insert: content || "",
|
||||
}
|
||||
})
|
||||
this.codeEditor.setText(content);
|
||||
// this.codeEditor.clearHistory();
|
||||
|
||||
// let info = CodeMirror.findModeByMIME(note.mime);
|
||||
|
||||
Reference in New Issue
Block a user