diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/assets/javascripts/ide/lib | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/assets/javascripts/ide/lib')
-rw-r--r-- | app/assets/javascripts/ide/lib/editor.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/ide/lib/editor.js b/app/assets/javascripts/ide/lib/editor.js index 6e90968f008..f061fcb1259 100644 --- a/app/assets/javascripts/ide/lib/editor.js +++ b/app/assets/javascripts/ide/lib/editor.js @@ -1,6 +1,5 @@ import { debounce } from 'lodash'; import { editor as monacoEditor, KeyCode, KeyMod, Range } from 'monaco-editor'; -import store from '../stores'; import DecorationsController from './decorations/controller'; import DirtyDiffController from './diff/controller'; import Disposable from './common/disposable'; @@ -20,14 +19,14 @@ function setupThemes() { } export default class Editor { - static create(options = {}) { + static create(...args) { if (!this.editorInstance) { - this.editorInstance = new Editor(options); + this.editorInstance = new Editor(...args); } return this.editorInstance; } - constructor(options = {}) { + constructor(store, options = {}) { this.currentModel = null; this.instance = null; this.dirtyDiffController = null; @@ -42,6 +41,7 @@ export default class Editor { ...defaultDiffEditorOptions, ...options, }; + this.store = store; setupThemes(); registerLanguages(...languages); @@ -215,6 +215,7 @@ export default class Editor { } addCommands() { + const { store } = this; const getKeyCode = key => { const monacoKeyMod = key.indexOf('KEY_') === 0; |