From 8992f2ebc0508ce24520e4df0b94be7eb2433886 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 24 Feb 2017 15:09:22 +0100 Subject: [PATCH] Rename wordWrap settings (#21262) --- .../common/config/commonEditorConfig.ts | 10 ++++---- src/vs/editor/common/editorCommon.ts | 10 ++++---- .../common/config/commonEditorConfig.test.ts | 24 +++++++++---------- .../viewModel/splitLinesCollection.test.ts | 4 ++-- .../viewModel/viewModelDecorations.test.ts | 4 ++-- src/vs/monaco.d.ts | 10 ++++---- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 59b69a763b3..39fa36790b8 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -213,12 +213,12 @@ class InternalEditorOptionsHelper { isViewportWrapping: true, wrappingColumn: Math.max(1, layoutInfo.viewportColumn) }; - } else if (wordWrap === 'clamped') { + } else if (wordWrap === 'bounded') { bareWrappingInfo = { isViewportWrapping: true, wrappingColumn: Math.min(Math.max(1, layoutInfo.viewportColumn), wordWrapColumn) }; - } else if (wordWrap === 'fixed') { + } else if (wordWrap === 'wordWrapColumn') { bareWrappingInfo = { isViewportWrapping: false, wrappingColumn: wordWrapColumn @@ -690,15 +690,15 @@ const editorConfiguration: IConfigurationNode = { }, 'editor.wordWrap': { 'type': 'string', - 'enum': ['off', 'on', 'fixed', 'clamped'], + 'enum': ['off', 'on', 'wordWrapColumn', 'bounded'], 'default': DefaultConfig.editor.wordWrap, - 'description': nls.localize('wordWrap', "Controls how lines should wrap. Can be: 'off' (disable wrapping), 'on' (viewport wrapping), 'fixed' (wrap at `editor.wordWrapColumn`) or 'clamped' (wrap at minimum of viewport and `editor.wordWrapColumn`).") + 'description': nls.localize('wordWrap', "Controls how lines should wrap. Can be: 'off' (disable wrapping), 'on' (viewport wrapping), 'wordWrapColumn' (wrap at `editor.wordWrapColumn`) or 'bounded' (wrap at minimum of viewport and `editor.wordWrapColumn`).") }, 'editor.wordWrapColumn': { 'type': 'integer', 'default': DefaultConfig.editor.wordWrapColumn, 'minimum': 1, - 'description': nls.localize('wordWrapColumn', "Controls the wrapping column of the editor when `editor.wordWrap` is 'fixed' or 'clamped'.") + 'description': nls.localize('wordWrapColumn', "Controls the wrapping column of the editor when `editor.wordWrap` is 'wordWrapColumn' or 'bounded'.") }, 'editor.wrappingIndent': { 'type': 'string', diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 50bde7463ef..3c69cb9cc4f 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -343,17 +343,17 @@ export interface IEditorOptions { * Control the wrapping of the editor. * When `wordWrap` = "off", the lines will never wrap. * When `wordWrap` = "on", the lines will wrap at the viewport width. - * When `wordWrap` = "fixed", the lines will wrap at `wordWrapColumn`. - * When `wordWrap` = "clamped", the lines will wrap at min(viewport width, wordWrapColumn). + * When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`. + * When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn). * Defaults to "off". */ - wordWrap?: 'off' | 'on' | 'fixed' | 'clamped'; + wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded'; /** * Control the wrapping of the editor. * When `wordWrap` = "off", the lines will never wrap. * When `wordWrap` = "on", the lines will wrap at the viewport width. - * When `wordWrap` = "fixed", the lines will wrap at `wordWrapColumn`. - * When `wordWrap` = "clamped", the lines will wrap at min(viewport width, wordWrapColumn). + * When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`. + * When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn). * Defaults to 80. */ wordWrapColumn?: number; diff --git a/src/vs/editor/test/common/config/commonEditorConfig.test.ts b/src/vs/editor/test/common/config/commonEditorConfig.test.ts index c805d3636ee..bda2f542ccb 100644 --- a/src/vs/editor/test/common/config/commonEditorConfig.test.ts +++ b/src/vs/editor/test/common/config/commonEditorConfig.test.ts @@ -111,47 +111,47 @@ suite('Common Editor Config', () => { assertWrapping(config, false, -1); }); - test('wordWrap fixed uses default wordWrapColumn', () => { + test('wordWrap wordWrapColumn uses default wordWrapColumn', () => { let config = new TestWrappingConfiguration({ - wordWrap: 'fixed' + wordWrap: 'wordWrapColumn' }); assertWrapping(config, false, 80); }); - test('wordWrap fixed uses wordWrapColumn', () => { + test('wordWrap wordWrapColumn uses wordWrapColumn', () => { let config = new TestWrappingConfiguration({ - wordWrap: 'fixed', + wordWrap: 'wordWrapColumn', wordWrapColumn: 100 }); assertWrapping(config, false, 100); }); - test('wordWrap fixed validates wordWrapColumn', () => { + test('wordWrap wordWrapColumn validates wordWrapColumn', () => { let config = new TestWrappingConfiguration({ - wordWrap: 'fixed', + wordWrap: 'wordWrapColumn', wordWrapColumn: -1 }); assertWrapping(config, false, 1); }); - test('wordWrap clamped uses default wordWrapColumn', () => { + test('wordWrap bounded uses default wordWrapColumn', () => { let config = new TestWrappingConfiguration({ - wordWrap: 'clamped' + wordWrap: 'bounded' }); assertWrapping(config, true, 80); }); - test('wordWrap clamped uses wordWrapColumn', () => { + test('wordWrap bounded uses wordWrapColumn', () => { let config = new TestWrappingConfiguration({ - wordWrap: 'clamped', + wordWrap: 'bounded', wordWrapColumn: 40 }); assertWrapping(config, true, 40); }); - test('wordWrap clamped validates wordWrapColumn', () => { + test('wordWrap bounded validates wordWrapColumn', () => { let config = new TestWrappingConfiguration({ - wordWrap: 'clamped', + wordWrap: 'bounded', wordWrapColumn: -1 }); assertWrapping(config, true, 1); diff --git a/src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts b/src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts index 756c9809064..286b91b0c88 100644 --- a/src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts +++ b/src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts @@ -559,7 +559,7 @@ suite('SplitLinesCollection', () => { }); test('getViewLinesData - with wrapping', () => { - withSplitLinesCollection(model, 'fixed', 30, (splitLinesCollection) => { + withSplitLinesCollection(model, 'wordWrapColumn', 30, (splitLinesCollection) => { assert.equal(splitLinesCollection.getViewLineCount(), 12); assert.equal(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.equal(splitLinesCollection.modelPositionIsVisible(2, 1), true); @@ -731,7 +731,7 @@ suite('SplitLinesCollection', () => { }); }); - function withSplitLinesCollection(model: Model, wordWrap: 'on' | 'off' | 'fixed' | 'clamped', wordWrapColumn: number, callback: (splitLinesCollection: SplitLinesCollection) => void): void { + function withSplitLinesCollection(model: Model, wordWrap: 'on' | 'off' | 'wordWrapColumn' | 'bounded', wordWrapColumn: number, callback: (splitLinesCollection: SplitLinesCollection) => void): void { let configuration = new TestConfiguration({ wordWrap: wordWrap, wordWrapColumn: wordWrapColumn, diff --git a/src/vs/editor/test/common/viewModel/viewModelDecorations.test.ts b/src/vs/editor/test/common/viewModel/viewModelDecorations.test.ts index 9fcdb5f1e14..2256c862534 100644 --- a/src/vs/editor/test/common/viewModel/viewModelDecorations.test.ts +++ b/src/vs/editor/test/common/viewModel/viewModelDecorations.test.ts @@ -15,7 +15,7 @@ suite('ViewModelDecorations', () => { 'hello world, this is a buffer that will be wrapped' ]; const opts: editorCommon.ICodeEditorWidgetCreationOptions = { - wordWrap: 'fixed', + wordWrap: 'wordWrapColumn', wordWrapColumn: 13 }; testViewModel(text, opts, (viewModel, model) => { @@ -270,7 +270,7 @@ suite('ViewModelDecorations', () => { 'hello world, this is a buffer that will be wrapped' ]; const opts: editorCommon.ICodeEditorWidgetCreationOptions = { - wordWrap: 'fixed', + wordWrap: 'wordWrapColumn', wordWrapColumn: 13 }; testViewModel(text, opts, (viewModel, model) => { diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 8d3f6058dac..f83d45fdc35 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1265,17 +1265,17 @@ declare module monaco.editor { * Control the wrapping of the editor. * When `wordWrap` = "off", the lines will never wrap. * When `wordWrap` = "on", the lines will wrap at the viewport width. - * When `wordWrap` = "fixed", the lines will wrap at `wordWrapColumn`. - * When `wordWrap` = "clamped", the lines will wrap at min(viewport width, wordWrapColumn). + * When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`. + * When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn). * Defaults to "off". */ - wordWrap?: 'off' | 'on' | 'fixed' | 'clamped'; + wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded'; /** * Control the wrapping of the editor. * When `wordWrap` = "off", the lines will never wrap. * When `wordWrap` = "on", the lines will wrap at the viewport width. - * When `wordWrap` = "fixed", the lines will wrap at `wordWrapColumn`. - * When `wordWrap` = "clamped", the lines will wrap at min(viewport width, wordWrapColumn). + * When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`. + * When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn). * Defaults to 80. */ wordWrapColumn?: number; -- GitLab