Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/ide/lib/editor.js')
-rw-r--r--app/assets/javascripts/ide/lib/editor.js9
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;