diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-06 18:07:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-06 18:07:26 +0300 |
commit | 506159637da758f448818b834f8482238a9eb4eb (patch) | |
tree | e114c46da6c1b98451a228b7559f5a6039c5df29 /app/assets/javascripts/ide/lib | |
parent | 045c0f9554a99c80d0a127540da168e272a9f977 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide/lib')
-rw-r--r-- | app/assets/javascripts/ide/lib/editor.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/ide/lib/editor.js b/app/assets/javascripts/ide/lib/editor.js index 02038fcb534..d1056ea6b98 100644 --- a/app/assets/javascripts/ide/lib/editor.js +++ b/app/assets/javascripts/ide/lib/editor.js @@ -23,20 +23,24 @@ export const clearDomElement = el => { }; export default class Editor { - static create() { + static create(options = {}) { if (!this.editorInstance) { - this.editorInstance = new Editor(); + this.editorInstance = new Editor(options); } return this.editorInstance; } - constructor() { + constructor(options = {}) { this.currentModel = null; this.instance = null; this.dirtyDiffController = null; this.disposable = new Disposable(); this.modelManager = new ModelManager(); this.decorationsController = new DecorationsController(this); + this.options = { + ...defaultEditorOptions, + ...options, + }; setupMonacoTheme(); @@ -51,7 +55,7 @@ export default class Editor { this.disposable.add( (this.instance = monacoEditor.create(domElement, { - ...defaultEditorOptions, + ...this.options, })), (this.dirtyDiffController = new DirtyDiffController( this.modelManager, @@ -71,7 +75,7 @@ export default class Editor { this.disposable.add( (this.instance = monacoEditor.createDiffEditor(domElement, { - ...defaultEditorOptions, + ...this.options, quickSuggestions: false, occurrencesHighlight: false, renderSideBySide: Editor.renderSideBySide(domElement), |