提交 d672ffad 编写于 作者: A Alex Dima

Rename minimap.renderText to minimap.renderCharacters (#20947)

上级 639558ef
......@@ -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',
......
......@@ -58,7 +58,7 @@ class ConfigClass implements IConfiguration {
},
minimap: {
enabled: false,
renderText: true
renderCharacters: true
},
fixedOverflowWidgets: false,
overviewRulerLanes: 2,
......
......@@ -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
);
}
......
......@@ -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;
}
......
......@@ -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,
......
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册