diff --git a/src/MonacoEditor.js b/src/MonacoEditor.js index 9afd834..b942bbf 100644 --- a/src/MonacoEditor.js +++ b/src/MonacoEditor.js @@ -48,6 +48,15 @@ export default { } }, + original(newValue) { + if (this.editor && this.diffEditor) { + const editor = this.getOriginalEditor() + if (newValue !== editor.getValue()) { + editor.setValue(newValue) + } + } + }, + language(newVal) { if (this.editor) { const editor = this.getModifiedEditor() @@ -137,6 +146,10 @@ export default { return this.diffEditor ? this.editor.getModifiedEditor() : this.editor }, + getOriginalEditor() { + return this.diffEditor ? this.editor.getOriginalEditor() : this.editor + }, + focus() { this.editor.focus() }