summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2018-03-28 09:04:09 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-03-28 09:04:09 +0000
commitb9ef51ee3f54f7028c3b314a54c953e9ca855dbc (patch)
tree510a0d8bab5ecf89f3952128e8762f8a7f3de734
parentc113b70057339609c5be02689a6ea0fdd51a19fc (diff)
parentfb5f908deb1a637a1c743b6ed18c5d585b16a42e (diff)
downloadgitlab-ce-b9ef51ee3f54f7028c3b314a54c953e9ca855dbc.tar.gz
Merge branch 'ide-wordwrap' into 'master'
Enable word wrap in IDE Closes #44303 See merge request gitlab-org/gitlab-ce!17994
-rw-r--r--app/assets/javascripts/ide/lib/editor_options.js1
-rw-r--r--spec/javascripts/ide/lib/editor_spec.js40
2 files changed, 17 insertions, 24 deletions
diff --git a/app/assets/javascripts/ide/lib/editor_options.js b/app/assets/javascripts/ide/lib/editor_options.js
index d69d4b8c615..a213862f9b3 100644
--- a/app/assets/javascripts/ide/lib/editor_options.js
+++ b/app/assets/javascripts/ide/lib/editor_options.js
@@ -6,6 +6,7 @@ export const defaultEditorOptions = {
minimap: {
enabled: false,
},
+ wordWrap: 'bounded',
};
export default [
diff --git a/spec/javascripts/ide/lib/editor_spec.js b/spec/javascripts/ide/lib/editor_spec.js
index 3c48d94d17a..2ccd87de1a7 100644
--- a/spec/javascripts/ide/lib/editor_spec.js
+++ b/spec/javascripts/ide/lib/editor_spec.js
@@ -64,22 +64,20 @@ describe('Multi-file editor library', () => {
instance.createDiffInstance(holder);
- expect(instance.monaco.editor.createDiffEditor).toHaveBeenCalledWith(
- holder,
- {
- model: null,
- contextmenu: true,
- minimap: {
- enabled: false,
- },
- readOnly: true,
- scrollBeyondLastLine: false,
- quickSuggestions: false,
- occurrencesHighlight: false,
- renderLineHighlight: 'none',
- hideCursorInOverviewRuler: true,
+ expect(instance.monaco.editor.createDiffEditor).toHaveBeenCalledWith(holder, {
+ model: null,
+ contextmenu: true,
+ minimap: {
+ enabled: false,
},
- );
+ readOnly: true,
+ scrollBeyondLastLine: false,
+ quickSuggestions: false,
+ occurrencesHighlight: false,
+ renderLineHighlight: 'none',
+ hideCursorInOverviewRuler: true,
+ wordWrap: 'bounded',
+ });
});
});
@@ -117,9 +115,7 @@ describe('Multi-file editor library', () => {
});
it('sets original & modified when diff editor', () => {
- spyOn(instance.instance, 'getEditorType').and.returnValue(
- 'vs.editor.IDiffEditor',
- );
+ spyOn(instance.instance, 'getEditorType').and.returnValue('vs.editor.IDiffEditor');
spyOn(instance.instance, 'setModel');
instance.attachModel(model);
@@ -135,9 +131,7 @@ describe('Multi-file editor library', () => {
instance.attachModel(model);
- expect(instance.dirtyDiffController.attachModel).toHaveBeenCalledWith(
- model,
- );
+ expect(instance.dirtyDiffController.attachModel).toHaveBeenCalledWith(model);
});
it('re-decorates with the dirty diff controller', () => {
@@ -145,9 +139,7 @@ describe('Multi-file editor library', () => {
instance.attachModel(model);
- expect(instance.dirtyDiffController.reDecorate).toHaveBeenCalledWith(
- model,
- );
+ expect(instance.dirtyDiffController.reDecorate).toHaveBeenCalledWith(model);
});
});