From d672ffad2ad3ff9f7251da5186d79fc16ce1700c Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 24 Feb 2017 11:58:56 +0100 Subject: [PATCH] Rename minimap.renderText to minimap.renderCharacters (#20947) --- .../common/config/commonEditorConfig.ts | 10 +++---- src/vs/editor/common/config/defaultConfig.ts | 2 +- src/vs/editor/common/editorCommon.ts | 10 +++---- .../common/viewLayout/editorLayoutProvider.ts | 8 +++--- .../viewLayout/editorLayoutProvider.test.ts | 26 +++++++++---------- src/vs/monaco.d.ts | 4 +-- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index dba1ab9a982..1e4f80affcf 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -185,7 +185,7 @@ class InternalEditorOptionsHelper { scrollbarArrowSize: scrollbar.arrowSize, verticalScrollbarHasArrows: scrollbar.verticalHasArrows, minimap: minimap.enabled, - minimapRenderText: minimap.renderText, + minimapRenderCharacters: minimap.renderCharacters, pixelRatio: pixelRatio }); @@ -373,7 +373,7 @@ class InternalEditorOptionsHelper { private static _sanitizeMinimapOpts(raw: editorCommon.IEditorMinimapOptions): editorCommon.InternalEditorMinimapOptions { return new editorCommon.InternalEditorMinimapOptions({ enabled: toBooleanWithDefault(raw.enabled, false), - renderText: toBooleanWithDefault(raw.renderText, true), + renderCharacters: toBooleanWithDefault(raw.renderCharacters, true), }); } } @@ -672,10 +672,10 @@ const editorConfiguration: IConfigurationNode = { 'default': DefaultConfig.editor.minimap.enabled, 'description': nls.localize('minimap.enabled', "Controls if the minimap is shown") }, - 'editor.minimap.renderText': { + 'editor.minimap.renderCharacters': { 'type': 'boolean', - 'default': DefaultConfig.editor.minimap.renderText, - 'description': nls.localize('minimap.renderText', "Render the actual text on a line (as opposed to color blocks)") + 'default': DefaultConfig.editor.minimap.renderCharacters, + 'description': nls.localize('minimap.renderCharacters', "Render the actual characters on a line (as opposed to color blocks)") }, 'editor.wordWrap': { 'type': 'string', diff --git a/src/vs/editor/common/config/defaultConfig.ts b/src/vs/editor/common/config/defaultConfig.ts index 184c8f9780b..c2d1084c8f8 100644 --- a/src/vs/editor/common/config/defaultConfig.ts +++ b/src/vs/editor/common/config/defaultConfig.ts @@ -58,7 +58,7 @@ class ConfigClass implements IConfiguration { }, minimap: { enabled: false, - renderText: true + renderCharacters: true }, fixedOverflowWidgets: false, overviewRulerLanes: 2, diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 56720ba9b62..588264b2bdc 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -167,7 +167,7 @@ export interface IEditorMinimapOptions { * Render the actual text on a line (as opposed to color blocks). * Defaults to true. */ - renderText?: boolean; + renderCharacters?: boolean; } /** @@ -647,17 +647,17 @@ export class InternalEditorMinimapOptions { readonly _internalEditorMinimapOptionsBrand: void; readonly enabled: boolean; - readonly renderText: boolean; + readonly renderCharacters: boolean; /** * @internal */ constructor(source: { enabled: boolean; - renderText: boolean; + renderCharacters: boolean; }) { this.enabled = Boolean(source.enabled); - this.renderText = Boolean(source.renderText); + this.renderCharacters = Boolean(source.renderCharacters); } /** @@ -666,7 +666,7 @@ export class InternalEditorMinimapOptions { public equals(other: InternalEditorMinimapOptions): boolean { return ( this.enabled === other.enabled - && this.renderText === other.renderText + && this.renderCharacters === other.renderCharacters ); } diff --git a/src/vs/editor/common/viewLayout/editorLayoutProvider.ts b/src/vs/editor/common/viewLayout/editorLayoutProvider.ts index 6642c2c3cc8..d97e1294708 100644 --- a/src/vs/editor/common/viewLayout/editorLayoutProvider.ts +++ b/src/vs/editor/common/viewLayout/editorLayoutProvider.ts @@ -28,7 +28,7 @@ export interface IEditorLayoutProviderOpts { horizontalScrollbarHeight: number; minimap: boolean; - minimapRenderText: boolean; + minimapRenderCharacters: boolean; pixelRatio: number; } @@ -49,7 +49,7 @@ export class EditorLayoutProvider { const scrollbarArrowSize = _opts.scrollbarArrowSize | 0; const horizontalScrollbarHeight = _opts.horizontalScrollbarHeight | 0; const minimap = Boolean(_opts.minimap); - const minimapRenderText = Boolean(_opts.minimapRenderText); + const minimapRenderCharacters = Boolean(_opts.minimapRenderCharacters); const pixelRatio = Number(_opts.pixelRatio); let lineNumbersWidth = 0; @@ -80,10 +80,10 @@ export class EditorLayoutProvider { } else { let minimapCharWidth: number; if (pixelRatio >= 2) { - renderMinimap = minimapRenderText ? RenderMinimap.Large : RenderMinimap.LargeBlocks; + renderMinimap = minimapRenderCharacters ? RenderMinimap.Large : RenderMinimap.LargeBlocks; minimapCharWidth = 2 / pixelRatio; } else { - renderMinimap = minimapRenderText ? RenderMinimap.Small : RenderMinimap.SmallBlocks; + renderMinimap = minimapRenderCharacters ? RenderMinimap.Small : RenderMinimap.SmallBlocks; minimapCharWidth = 1 / pixelRatio; } diff --git a/src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts b/src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts index f9936e7d48f..2101d0aeec7 100644 --- a/src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts +++ b/src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts @@ -32,7 +32,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 1000, @@ -87,7 +87,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 13, verticalScrollbarHasArrows: true, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 1000, @@ -142,7 +142,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 900, @@ -197,7 +197,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 900, @@ -252,7 +252,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 900, @@ -307,7 +307,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 900, @@ -362,7 +362,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 900, @@ -417,7 +417,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 900, @@ -472,7 +472,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 900, @@ -527,7 +527,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: false, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 900, @@ -582,7 +582,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: true, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 1, }, new EditorLayoutInfo({ width: 1000, @@ -637,7 +637,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: true, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 2, }, new EditorLayoutInfo({ width: 1000, @@ -692,7 +692,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scrollbarArrowSize: 0, verticalScrollbarHasArrows: false, minimap: true, - minimapRenderText: true, + minimapRenderCharacters: true, pixelRatio: 4, }, new EditorLayoutInfo({ width: 1000, diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 04c2f68d897..d2abf949d29 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1089,7 +1089,7 @@ declare module monaco.editor { * Render the actual text on a line (as opposed to color blocks). * Defaults to true. */ - renderText?: boolean; + renderCharacters?: boolean; } /** @@ -1503,7 +1503,7 @@ declare module monaco.editor { export class InternalEditorMinimapOptions { readonly _internalEditorMinimapOptionsBrand: void; readonly enabled: boolean; - readonly renderText: boolean; + readonly renderCharacters: boolean; } export class EditorWrappingInfo { -- GitLab