Commit 891164f1 authored by Phil Hughes's avatar Phil Hughes

set `renderSideBySide` when creating diff instance

parent bc64e20c
...@@ -69,6 +69,7 @@ export default class Editor { ...@@ -69,6 +69,7 @@ export default class Editor {
occurrencesHighlight: false, occurrencesHighlight: false,
renderLineHighlight: 'none', renderLineHighlight: 'none',
hideCursorInOverviewRuler: true, hideCursorInOverviewRuler: true,
renderSideBySide: this.renderSideBySide(domElement),
})), })),
); );
...@@ -177,11 +178,15 @@ export default class Editor { ...@@ -177,11 +178,15 @@ export default class Editor {
if (!this.isDiffEditorType) return; if (!this.isDiffEditorType) return;
this.instance.updateOptions({ this.instance.updateOptions({
renderSideBySide: this.instance.getDomNode().offsetWidth >= 700, renderSideBySide: this.renderSideBySide(this.instance.getDomNode()),
}); });
} }
get isDiffEditorType() { get isDiffEditorType() {
return this.instance.getEditorType() === 'vs.editor.IDiffEditor'; return this.instance.getEditorType() === 'vs.editor.IDiffEditor';
} }
renderSideBySide(domElement) {
return domElement.offsetWidth >= 700;
}
} }
...@@ -77,6 +77,7 @@ describe('Multi-file editor library', () => { ...@@ -77,6 +77,7 @@ describe('Multi-file editor library', () => {
renderLineHighlight: 'none', renderLineHighlight: 'none',
hideCursorInOverviewRuler: true, hideCursorInOverviewRuler: true,
wordWrap: 'on', wordWrap: 'on',
renderSideBySide: true,
}); });
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment