mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +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.
|
* @param {*} content the new content of the note.
|
||||||
*/
|
*/
|
||||||
_update(note: { mime: string }, content: string) {
|
_update(note: { mime: string }, content: string) {
|
||||||
// // CodeMirror breaks pretty badly on null, so even though it shouldn't happen (guarded by a consistency check)
|
this.codeEditor.dispatch({
|
||||||
// // we provide fallback
|
changes: {
|
||||||
// this.codeEditor.setValue(content || "");
|
from: 0,
|
||||||
|
to: this.codeEditor.state.doc.length,
|
||||||
|
insert: content || "",
|
||||||
|
}
|
||||||
|
})
|
||||||
// this.codeEditor.clearHistory();
|
// this.codeEditor.clearHistory();
|
||||||
|
|
||||||
// let info = CodeMirror.findModeByMIME(note.mime);
|
// let info = CodeMirror.findModeByMIME(note.mime);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user