summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
commit6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch)
tree78be5963ec075d80116a932011d695dd33910b4e /app/assets/javascripts/ide/lib
parent1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff)
downloadgitlab-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.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;