mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
fix(code): set initial text
This commit is contained in:
parent
c84a390699
commit
0c9be9291b
@ -56,9 +56,13 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
|
||||
* @param {*} content the new content of the note.
|
||||
*/
|
||||
_update(note: { mime: string }, content: string) {
|
||||
// // CodeMirror breaks pretty badly on null, so even though it shouldn't happen (guarded by a consistency check)
|
||||
// // we provide fallback
|
||||
// this.codeEditor.setValue(content || "");
|
||||
this.codeEditor.dispatch({
|
||||
changes: {
|
||||
from: 0,
|
||||
to: this.codeEditor.state.doc.length,
|
||||
insert: content || "",
|
||||
}
|
||||
})
|
||||
// this.codeEditor.clearHistory();
|
||||
|
||||
// let info = CodeMirror.findModeByMIME(note.mime);
|
||||
|
Loading…
x
Reference in New Issue
Block a user