summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-11-29 10:26:35 +0000
committerPhil Hughes <me@iamphill.com>2017-11-29 10:26:35 +0000
commit1880809d8ef9b650d1af615ebbaa590626ccf17f (patch)
treeeef870533780f46d46a638446ceaa7e878122627
parentd22bb0397b04f2870c6fbbeb2912ef6627e4afb7 (diff)
downloadgitlab-ce-1880809d8ef9b650d1af615ebbaa590626ccf17f.tar.gz
added editor options to redcue EE conflicts
-rw-r--r--app/assets/javascripts/repo/lib/editor.js10
-rw-r--r--app/assets/javascripts/repo/lib/editor_options.js2
-rw-r--r--spec/javascripts/repo/lib/editor_options_spec.js7
3 files changed, 19 insertions, 0 deletions
diff --git a/app/assets/javascripts/repo/lib/editor.js b/app/assets/javascripts/repo/lib/editor.js
index e82fbfc0e9c..db499444402 100644
--- a/app/assets/javascripts/repo/lib/editor.js
+++ b/app/assets/javascripts/repo/lib/editor.js
@@ -2,6 +2,7 @@ import DecorationsController from './decorations/controller';
import DirtyDiffController from './diff/controller';
import Disposable from './common/disposable';
import ModelManager from './common/model_manager';
+import editorOptions from './editor_options';
export default class Editor {
static create(monaco) {
@@ -49,6 +50,15 @@ export default class Editor {
this.currentModel = model;
+ this.instance.updateOptions(editorOptions.reduce((acc, obj) => {
+ Object.keys(obj).forEach((key) => {
+ Object.assign(acc, {
+ [key]: obj[key](model),
+ });
+ });
+ return acc;
+ }, {}));
+
this.dirtyDiffController.reDecorate(model);
}
diff --git a/app/assets/javascripts/repo/lib/editor_options.js b/app/assets/javascripts/repo/lib/editor_options.js
new file mode 100644
index 00000000000..701affc466e
--- /dev/null
+++ b/app/assets/javascripts/repo/lib/editor_options.js
@@ -0,0 +1,2 @@
+export default [{
+}];
diff --git a/spec/javascripts/repo/lib/editor_options_spec.js b/spec/javascripts/repo/lib/editor_options_spec.js
new file mode 100644
index 00000000000..b4887d063ed
--- /dev/null
+++ b/spec/javascripts/repo/lib/editor_options_spec.js
@@ -0,0 +1,7 @@
+import editorOptions from '~/repo/lib/editor_options';
+
+describe('Multi-file editor library editor options', () => {
+ it('returns an array', () => {
+ expect(editorOptions).toEqual(jasmine.any(Array));
+ });
+});