mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-03-14 10:42:49 -07:00
CodeMirror plugin now refreshes the tiddler type
This commit is contained in:
parent
fdbde1b389
commit
d8366cc45f
1 changed files with 5 additions and 3 deletions
|
|
@ -173,18 +173,20 @@ EditCodeMirrorWidget.prototype.refresh = function(changedTiddlers) {
|
|||
this.refreshSelf();
|
||||
return true;
|
||||
} else if(changedTiddlers[this.editTitle]) {
|
||||
this.updateEditor(this.getEditInfo().value);
|
||||
var editInfo = this.getEditInfo();
|
||||
this.updateEditor(editInfo.value, editInfo.type);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/*
|
||||
Update the editor with new text. This method is separate from updateEditorDomNode()
|
||||
Update the editor with new text and type. This method is separate from updateEditorDomNode()
|
||||
so that subclasses can override updateEditor() and still use updateEditorDomNode()
|
||||
*/
|
||||
EditCodeMirrorWidget.prototype.updateEditor = function(text) {
|
||||
EditCodeMirrorWidget.prototype.updateEditor = function(text, type) {
|
||||
this.updateEditorDomNode(text);
|
||||
this.codeMirrorInstance.setOption("mode", type);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue