Skip to content

Commit d6d9148

Browse files
committed
Fixes microsoft#89573: Rename setting and possible values
1 parent f4fae2e commit d6d9148

7 files changed

Lines changed: 35 additions & 35 deletions

File tree

src/vs/editor/common/config/editorOptions.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ export interface IEditorOptions {
267267
*/
268268
wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';
269269
/**
270-
* Controls the wrapping algorithm to use.
271-
* Defaults to 'monospace'.
270+
* Controls the wrapping strategy to use.
271+
* Defaults to 'simple'.
272272
*/
273-
wrappingAlgorithm?: 'monospace' | 'dom';
273+
wrappingStrategy?: 'simple' | 'advanced';
274274
/**
275275
* Configure word wrapping characters. A break will be introduced before these characters.
276276
* Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'.
@@ -3230,7 +3230,7 @@ export const enum EditorOption {
32303230
wordWrapColumn,
32313231
wordWrapMinified,
32323232
wrappingIndent,
3233-
wrappingAlgorithm,
3233+
wrappingStrategy,
32343234

32353235
// Leave these at the end (because they have dependencies!)
32363236
editorClassName,
@@ -3822,16 +3822,16 @@ export const EditorOptions = {
38223822
description: nls.localize('wrappingIndent', "Controls the indentation of wrapped lines."),
38233823
}
38243824
)),
3825-
wrappingAlgorithm: register(new EditorStringEnumOption(
3826-
EditorOption.wrappingAlgorithm, 'wrappingAlgorithm',
3827-
'monospace' as 'monospace' | 'dom',
3828-
['monospace', 'dom'] as const,
3825+
wrappingStrategy: register(new EditorStringEnumOption(
3826+
EditorOption.wrappingStrategy, 'wrappingStrategy',
3827+
'simple' as 'simple' | 'advanced',
3828+
['simple', 'advanced'] as const,
38293829
{
38303830
enumDescriptions: [
3831-
nls.localize('wrappingAlgorithm.monospace', "Assumes that all characters are of the same width. This is a fast algorithm."),
3832-
nls.localize('wrappingAlgorithm.dom', "Delegates wrapping points computation to the DOM. This is a slow algorithm, that might cause freezes for large files.")
3831+
nls.localize('wrappingStrategy.simple', "Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),
3832+
nls.localize('wrappingStrategy.advanced', "Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")
38333833
],
3834-
description: nls.localize('wrappingAlgorithm', "Controls the algorithm that computes wrapping points.")
3834+
description: nls.localize('wrappingStrategy', "Controls the algorithm that computes wrapping points.")
38353835
}
38363836
)),
38373837

src/vs/editor/common/standalone/standaloneEnums.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export enum EditorOption {
269269
wordWrapColumn = 101,
270270
wordWrapMinified = 102,
271271
wrappingIndent = 103,
272-
wrappingAlgorithm = 104,
272+
wrappingStrategy = 104,
273273
editorClassName = 105,
274274
pixelRatio = 106,
275275
tabFocusMode = 107,

src/vs/editor/common/viewModel/splitLinesCollection.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export interface ISplitLine {
109109
export interface IViewModelLinesCollection extends IDisposable {
110110
createCoordinatesConverter(): ICoordinatesConverter;
111111

112-
setWrappingSettings(fontInfo: FontInfo, wrappingAlgorithm: 'monospace' | 'dom', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean;
112+
setWrappingSettings(fontInfo: FontInfo, wrappingStrategy: 'simple' | 'advanced', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean;
113113
setTabSize(newTabSize: number): boolean;
114114
getHiddenAreas(): Range[];
115115
setHiddenAreas(_ranges: Range[]): boolean;
@@ -277,7 +277,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
277277
private tabSize: number;
278278
private wrappingColumn: number;
279279
private wrappingIndent: WrappingIndent;
280-
private wrappingAlgorithm: 'monospace' | 'dom';
280+
private wrappingStrategy: 'simple' | 'advanced';
281281
private lines!: ISplitLine[];
282282

283283
private prefixSumComputer!: LineNumberMapper;
@@ -290,7 +290,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
290290
monospaceLineBreaksComputerFactory: ILineBreaksComputerFactory,
291291
fontInfo: FontInfo,
292292
tabSize: number,
293-
wrappingAlgorithm: 'monospace' | 'dom',
293+
wrappingStrategy: 'simple' | 'advanced',
294294
wrappingColumn: number,
295295
wrappingIndent: WrappingIndent,
296296
) {
@@ -300,7 +300,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
300300
this._monospaceLineBreaksComputerFactory = monospaceLineBreaksComputerFactory;
301301
this.fontInfo = fontInfo;
302302
this.tabSize = tabSize;
303-
this.wrappingAlgorithm = wrappingAlgorithm;
303+
this.wrappingStrategy = wrappingStrategy;
304304
this.wrappingColumn = wrappingColumn;
305305
this.wrappingIndent = wrappingIndent;
306306

@@ -484,19 +484,19 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
484484
return true;
485485
}
486486

487-
public setWrappingSettings(fontInfo: FontInfo, wrappingAlgorithm: 'monospace' | 'dom', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean {
487+
public setWrappingSettings(fontInfo: FontInfo, wrappingStrategy: 'simple' | 'advanced', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean {
488488
const equalFontInfo = this.fontInfo.equals(fontInfo);
489-
const equalWrappingAlgorithm = (this.wrappingAlgorithm === wrappingAlgorithm);
489+
const equalWrappingStrategy = (this.wrappingStrategy === wrappingStrategy);
490490
const equalWrappingColumn = (this.wrappingColumn === wrappingColumn);
491491
const equalWrappingIndent = (this.wrappingIndent === wrappingIndent);
492-
if (equalFontInfo && equalWrappingAlgorithm && equalWrappingColumn && equalWrappingIndent) {
492+
if (equalFontInfo && equalWrappingStrategy && equalWrappingColumn && equalWrappingIndent) {
493493
return false;
494494
}
495495

496-
const onlyWrappingColumnChanged = (equalFontInfo && equalWrappingAlgorithm && !equalWrappingColumn && equalWrappingIndent);
496+
const onlyWrappingColumnChanged = (equalFontInfo && equalWrappingStrategy && !equalWrappingColumn && equalWrappingIndent);
497497

498498
this.fontInfo = fontInfo;
499-
this.wrappingAlgorithm = wrappingAlgorithm;
499+
this.wrappingStrategy = wrappingStrategy;
500500
this.wrappingColumn = wrappingColumn;
501501
this.wrappingIndent = wrappingIndent;
502502

@@ -515,7 +515,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
515515

516516
public createLineBreaksComputer(): ILineBreaksComputer {
517517
const lineBreaksComputerFactory = (
518-
this.wrappingAlgorithm === 'dom'
518+
this.wrappingStrategy === 'advanced'
519519
? this._domLineBreaksComputerFactory
520520
: this._monospaceLineBreaksComputerFactory
521521
);
@@ -1460,7 +1460,7 @@ export class IdentityLinesCollection implements IViewModelLinesCollection {
14601460
return false;
14611461
}
14621462

1463-
public setWrappingSettings(_fontInfo: FontInfo, _wrappingAlgorithm: 'monospace' | 'dom', _wrappingColumn: number, _wrappingIndent: WrappingIndent): boolean {
1463+
public setWrappingSettings(_fontInfo: FontInfo, _wrappingStrategy: 'simple' | 'advanced', _wrappingColumn: number, _wrappingIndent: WrappingIndent): boolean {
14641464
return false;
14651465
}
14661466

src/vs/editor/common/viewModel/viewModelImpl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel
6868
} else {
6969
const options = this.configuration.options;
7070
const fontInfo = options.get(EditorOption.fontInfo);
71-
const wrappingAlgorithm = options.get(EditorOption.wrappingAlgorithm);
71+
const wrappingStrategy = options.get(EditorOption.wrappingStrategy);
7272
const wrappingInfo = options.get(EditorOption.wrappingInfo);
7373
const wrappingIndent = options.get(EditorOption.wrappingIndent);
7474

@@ -78,7 +78,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel
7878
monospaceLineBreaksComputerFactory,
7979
fontInfo,
8080
this.model.getOptions().tabSize,
81-
wrappingAlgorithm,
81+
wrappingStrategy,
8282
wrappingInfo.wrappingColumn,
8383
wrappingIndent
8484
);
@@ -165,11 +165,11 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel
165165

166166
const options = this.configuration.options;
167167
const fontInfo = options.get(EditorOption.fontInfo);
168-
const wrappingAlgorithm = options.get(EditorOption.wrappingAlgorithm);
168+
const wrappingStrategy = options.get(EditorOption.wrappingStrategy);
169169
const wrappingInfo = options.get(EditorOption.wrappingInfo);
170170
const wrappingIndent = options.get(EditorOption.wrappingIndent);
171171

172-
if (this.lines.setWrappingSettings(fontInfo, wrappingAlgorithm, wrappingInfo.wrappingColumn, wrappingIndent)) {
172+
if (this.lines.setWrappingSettings(fontInfo, wrappingStrategy, wrappingInfo.wrappingColumn, wrappingIndent)) {
173173
eventsCollector.emit(new viewEvents.ViewFlushedEvent());
174174
eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent());
175175
eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent());

src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ suite('Editor ViewModel - SplitLinesCollection', () => {
111111
lineBreaksComputerFactory,
112112
fontInfo,
113113
model.getOptions().tabSize,
114-
'monospace',
114+
'simple',
115115
wrappingInfo.wrappingColumn,
116116
wrappingIndent
117117
);
@@ -753,7 +753,7 @@ suite('SplitLinesCollection', () => {
753753
lineBreaksComputerFactory,
754754
fontInfo,
755755
model.getOptions().tabSize,
756-
'monospace',
756+
'simple',
757757
wrappingInfo.wrappingColumn,
758758
wrappingIndent
759759
);

src/vs/monaco.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,10 +2747,10 @@ declare namespace monaco.editor {
27472747
*/
27482748
wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';
27492749
/**
2750-
* Controls the wrapping algorithm to use.
2751-
* Defaults to 'monospace'.
2750+
* Controls the wrapping strategy to use.
2751+
* Defaults to 'simple'.
27522752
*/
2753-
wrappingAlgorithm?: 'monospace' | 'dom';
2753+
wrappingStrategy?: 'simple' | 'advanced';
27542754
/**
27552755
* Configure word wrapping characters. A break will be introduced before these characters.
27562756
* Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'.
@@ -3799,7 +3799,7 @@ declare namespace monaco.editor {
37993799
wordWrapColumn = 101,
38003800
wordWrapMinified = 102,
38013801
wrappingIndent = 103,
3802-
wrappingAlgorithm = 104,
3802+
wrappingStrategy = 104,
38033803
editorClassName = 105,
38043804
pixelRatio = 106,
38053805
tabFocusMode = 107,
@@ -3911,7 +3911,7 @@ declare namespace monaco.editor {
39113911
wordWrapColumn: IEditorOption<EditorOption.wordWrapColumn, number>;
39123912
wordWrapMinified: IEditorOption<EditorOption.wordWrapMinified, boolean>;
39133913
wrappingIndent: IEditorOption<EditorOption.wrappingIndent, WrappingIndent>;
3914-
wrappingAlgorithm: IEditorOption<EditorOption.wrappingAlgorithm, 'monospace' | 'dom'>;
3914+
wrappingStrategy: IEditorOption<EditorOption.wrappingStrategy, 'simple' | 'advanced'>;
39153915
editorClassName: IEditorOption<EditorOption.editorClassName, string>;
39163916
pixelRatio: IEditorOption<EditorOption.pixelRatio, number>;
39173917
tabFocusMode: IEditorOption<EditorOption.tabFocusMode, boolean>;

src/vs/workbench/contrib/scm/browser/repositoryPane.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ export class RepositoryPane extends ViewPane {
719719
fontSize: 13,
720720
lineHeight: 20,
721721
fontFamily: ' -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif',
722-
wrappingAlgorithm: 'dom',
722+
wrappingStrategy: 'advanced',
723723
wrappingIndent: 'none',
724724
// suggest: {
725725
// showWords: false

0 commit comments

Comments
 (0)