Skip to content

Commit 82db01c

Browse files
authored
Merge pull request microsoft#156242 from Albert-cord/feat/wordBreak
feat: Add wordBreak editorOption and use it to lineBreakComputer function
2 parents 22c0e9a + db744ee commit 82db01c

File tree

10 files changed

+126
-66
lines changed

10 files changed

+126
-66
lines changed

src/vs/editor/browser/view/domLineBreaksComputer.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class DOMLineBreaksComputerFactory implements ILineBreaksComputerFactory
2424
constructor() {
2525
}
2626

27-
public createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer {
27+
public createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll'): ILineBreaksComputer {
2828
const requests: string[] = [];
2929
const injectedTexts: (LineInjectedText[] | null)[] = [];
3030
return {
@@ -33,13 +33,13 @@ export class DOMLineBreaksComputerFactory implements ILineBreaksComputerFactory
3333
injectedTexts.push(injectedText);
3434
},
3535
finalize: () => {
36-
return createLineBreaks(requests, fontInfo, tabSize, wrappingColumn, wrappingIndent, injectedTexts);
36+
return createLineBreaks(requests, fontInfo, tabSize, wrappingColumn, wrappingIndent, wordBreak, injectedTexts);
3737
}
3838
};
3939
}
4040
}
4141

42-
function createLineBreaks(requests: string[], fontInfo: FontInfo, tabSize: number, firstLineBreakColumn: number, wrappingIndent: WrappingIndent, injectedTextsPerLine: (LineInjectedText[] | null)[]): (ModelLineProjectionData | null)[] {
42+
function createLineBreaks(requests: string[], fontInfo: FontInfo, tabSize: number, firstLineBreakColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll', injectedTextsPerLine: (LineInjectedText[] | null)[]): (ModelLineProjectionData | null)[] {
4343
function createEmptyLineBreakWithPossiblyInjectedText(requestIdx: number): ModelLineProjectionData | null {
4444
const injectedTexts = injectedTextsPerLine[requestIdx];
4545
if (injectedTexts) {
@@ -129,7 +129,15 @@ function createLineBreaks(requests: string[], fontInfo: FontInfo, tabSize: numbe
129129

130130
containerDomNode.style.position = 'absolute';
131131
containerDomNode.style.top = '10000';
132-
containerDomNode.style.wordWrap = 'break-word';
132+
if (wordBreak === 'keepAll') {
133+
// word-break: keep-all; overflow-wrap: anywhere
134+
containerDomNode.style.wordBreak = 'keep-all';
135+
containerDomNode.style.overflowWrap = 'anywhere';
136+
} else {
137+
// overflow-wrap: break-word
138+
containerDomNode.style.wordBreak = 'inherit';
139+
containerDomNode.style.overflowWrap = 'break-word';
140+
}
133141
document.body.appendChild(containerDomNode);
134142

135143
const range = document.createRange();

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,12 @@ export interface IEditorOptions {
311311
* Configure word wrapping characters. A break will be introduced after these characters.
312312
*/
313313
wordWrapBreakAfterCharacters?: string;
314+
/**
315+
* Sets whether line breaks appear wherever the text would otherwise overflow its content box.
316+
* When wordBreak = 'normal', Use the default line break rule.
317+
* When wordBreak = 'keepAll', Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.
318+
*/
319+
wordBreak?: 'normal' | 'keepAll';
314320
/**
315321
* Performance guard: Stop rendering a line after x characters.
316322
* Defaults to 10000.
@@ -4769,6 +4775,7 @@ export const enum EditorOption {
47694775
unusualLineTerminators,
47704776
useShadowDOM,
47714777
useTabStops,
4778+
wordBreak,
47724779
wordSeparators,
47734780
wordWrap,
47744781
wordWrapBreakAfterCharacters,
@@ -5381,6 +5388,18 @@ export const EditorOptions = {
53815388
EditorOption.useTabStops, 'useTabStops', true,
53825389
{ description: nls.localize('useTabStops', "Inserting and deleting whitespace follows tab stops.") }
53835390
)),
5391+
wordBreak: register(new EditorStringEnumOption(
5392+
EditorOption.wordBreak, 'wordBreak',
5393+
'normal' as 'normal' | 'keepAll',
5394+
['normal', 'keepAll'] as const,
5395+
{
5396+
markdownEnumDescriptions: [
5397+
nls.localize('wordBreak.normal', "Use the default line break rule."),
5398+
nls.localize('wordBreak.keepAll', "Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal."),
5399+
],
5400+
description: nls.localize('wordBreak', "Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")
5401+
}
5402+
)),
53845403
wordSeparators: register(new EditorStringOption(
53855404
EditorOption.wordSeparators, 'wordSeparators', USUAL_WORD_SEPARATORS,
53865405
{ description: nls.localize('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations.") }

src/vs/editor/common/modelLineProjectionData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export class OutputPosition {
329329
}
330330

331331
export interface ILineBreaksComputerFactory {
332-
createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer;
332+
createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll'): ILineBreaksComputer;
333333
}
334334

335335
export interface ILineBreaksComputer {

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -291,22 +291,23 @@ export enum EditorOption {
291291
unusualLineTerminators = 116,
292292
useShadowDOM = 117,
293293
useTabStops = 118,
294-
wordSeparators = 119,
295-
wordWrap = 120,
296-
wordWrapBreakAfterCharacters = 121,
297-
wordWrapBreakBeforeCharacters = 122,
298-
wordWrapColumn = 123,
299-
wordWrapOverride1 = 124,
300-
wordWrapOverride2 = 125,
301-
wrappingIndent = 126,
302-
wrappingStrategy = 127,
303-
showDeprecated = 128,
304-
inlayHints = 129,
305-
editorClassName = 130,
306-
pixelRatio = 131,
307-
tabFocusMode = 132,
308-
layoutInfo = 133,
309-
wrappingInfo = 134
294+
wordBreak = 119,
295+
wordSeparators = 120,
296+
wordWrap = 121,
297+
wordWrapBreakAfterCharacters = 122,
298+
wordWrapBreakBeforeCharacters = 123,
299+
wordWrapColumn = 124,
300+
wordWrapOverride1 = 125,
301+
wordWrapOverride2 = 126,
302+
wrappingIndent = 127,
303+
wrappingStrategy = 128,
304+
showDeprecated = 129,
305+
inlayHints = 130,
306+
editorClassName = 131,
307+
pixelRatio = 132,
308+
tabFocusMode = 133,
309+
layoutInfo = 134,
310+
wrappingInfo = 135
310311
}
311312

312313
/**

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class MonospaceLineBreaksComputerFactory implements ILineBreaksComputerFa
2626
this.classifier = new WrappingCharacterClassifier(breakBeforeChars, breakAfterChars);
2727
}
2828

29-
public createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer {
29+
public createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll'): ILineBreaksComputer {
3030
const requests: string[] = [];
3131
const injectedTexts: (LineInjectedText[] | null)[] = [];
3232
const previousBreakingData: (ModelLineProjectionData | null)[] = [];
@@ -43,9 +43,9 @@ export class MonospaceLineBreaksComputerFactory implements ILineBreaksComputerFa
4343
const injectedText = injectedTexts[i];
4444
const previousLineBreakData = previousBreakingData[i];
4545
if (previousLineBreakData && !previousLineBreakData.injectionOptions && !injectedText) {
46-
result[i] = createLineBreaksFromPreviousLineBreaks(this.classifier, previousLineBreakData, requests[i], tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent);
46+
result[i] = createLineBreaksFromPreviousLineBreaks(this.classifier, previousLineBreakData, requests[i], tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent, wordBreak);
4747
} else {
48-
result[i] = createLineBreaks(this.classifier, requests[i], injectedText, tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent);
48+
result[i] = createLineBreaks(this.classifier, requests[i], injectedText, tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent, wordBreak);
4949
}
5050
}
5151
arrPool1.length = 0;
@@ -101,7 +101,7 @@ class WrappingCharacterClassifier extends CharacterClassifier<CharacterClass> {
101101
let arrPool1: number[] = [];
102102
let arrPool2: number[] = [];
103103

104-
function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterClassifier, previousBreakingData: ModelLineProjectionData, lineText: string, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): ModelLineProjectionData | null {
104+
function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterClassifier, previousBreakingData: ModelLineProjectionData, lineText: string, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll'): ModelLineProjectionData | null {
105105
if (firstLineBreakColumn === -1) {
106106
return null;
107107
}
@@ -111,6 +111,8 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
111111
return null;
112112
}
113113

114+
const isKeepAll = (wordBreak === 'keepAll');
115+
114116
const prevBreakingOffsets = previousBreakingData.breakOffsets;
115117
const prevBreakingOffsetsVisibleColumn = previousBreakingData.breakOffsetsVisibleColumn;
116118

@@ -176,7 +178,7 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
176178
charWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar);
177179
}
178180

179-
if (charStartOffset > lastBreakingOffset && canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) {
181+
if (charStartOffset > lastBreakingOffset && canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass, isKeepAll)) {
180182
breakOffset = charStartOffset;
181183
breakOffsetVisibleColumn = visibleColumn;
182184
}
@@ -260,7 +262,7 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
260262
break;
261263
}
262264

263-
if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) {
265+
if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass, isKeepAll)) {
264266
breakOffset = charStartOffset;
265267
breakOffsetVisibleColumn = visibleColumn;
266268
break;
@@ -353,7 +355,7 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
353355
return previousBreakingData;
354356
}
355357

356-
function createLineBreaks(classifier: WrappingCharacterClassifier, _lineText: string, injectedTexts: LineInjectedText[] | null, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): ModelLineProjectionData | null {
358+
function createLineBreaks(classifier: WrappingCharacterClassifier, _lineText: string, injectedTexts: LineInjectedText[] | null, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll'): ModelLineProjectionData | null {
357359
const lineText = LineInjectedText.applyInjectedText(_lineText, injectedTexts);
358360

359361
let injectionOptions: InjectedTextOptions[] | null;
@@ -385,6 +387,7 @@ function createLineBreaks(classifier: WrappingCharacterClassifier, _lineText: st
385387
return new ModelLineProjectionData(injectionOffsets, injectionOptions, [lineText.length], [], 0);
386388
}
387389

390+
const isKeepAll = (wordBreak === 'keepAll');
388391
const wrappedTextIndentLength = computeWrappedTextIndentLength(lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent);
389392
const wrappedLineBreakColumn = firstLineBreakColumn - wrappedTextIndentLength;
390393

@@ -424,7 +427,7 @@ function createLineBreaks(classifier: WrappingCharacterClassifier, _lineText: st
424427
charWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar);
425428
}
426429

427-
if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) {
430+
if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass, isKeepAll)) {
428431
breakOffset = charStartOffset;
429432
breakOffsetVisibleColumn = visibleColumn;
430433
}
@@ -485,14 +488,14 @@ function tabCharacterWidth(visibleColumn: number, tabSize: number): number {
485488
* Kinsoku Shori : Don't break after a leading character, like an open bracket
486489
* Kinsoku Shori : Don't break before a trailing character, like a period
487490
*/
488-
function canBreak(prevCharCode: number, prevCharCodeClass: CharacterClass, charCode: number, charCodeClass: CharacterClass): boolean {
491+
function canBreak(prevCharCode: number, prevCharCodeClass: CharacterClass, charCode: number, charCodeClass: CharacterClass, isKeepAll: boolean): boolean {
489492
return (
490493
charCode !== CharCode.Space
491494
&& (
492495
(prevCharCodeClass === CharacterClass.BREAK_AFTER && charCodeClass !== CharacterClass.BREAK_AFTER) // break at the end of multiple BREAK_AFTER
493496
|| (prevCharCodeClass !== CharacterClass.BREAK_BEFORE && charCodeClass === CharacterClass.BREAK_BEFORE) // break at the start of multiple BREAK_BEFORE
494-
|| (prevCharCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && charCodeClass !== CharacterClass.BREAK_AFTER)
495-
|| (charCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && prevCharCodeClass !== CharacterClass.BREAK_BEFORE)
497+
|| (!isKeepAll && prevCharCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && charCodeClass !== CharacterClass.BREAK_AFTER)
498+
|| (!isKeepAll && charCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && prevCharCodeClass !== CharacterClass.BREAK_BEFORE)
496499
)
497500
);
498501
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export class ViewModel extends Disposable implements IViewModel {
9393
const wrappingStrategy = options.get(EditorOption.wrappingStrategy);
9494
const wrappingInfo = options.get(EditorOption.wrappingInfo);
9595
const wrappingIndent = options.get(EditorOption.wrappingIndent);
96+
const wordBreak = options.get(EditorOption.wordBreak);
9697

9798
this._lines = new ViewModelLinesFromProjectedModel(
9899
this._editorId,
@@ -103,7 +104,8 @@ export class ViewModel extends Disposable implements IViewModel {
103104
this.model.getOptions().tabSize,
104105
wrappingStrategy,
105106
wrappingInfo.wrappingColumn,
106-
wrappingIndent
107+
wrappingIndent,
108+
wordBreak
107109
);
108110
}
109111

@@ -230,8 +232,9 @@ export class ViewModel extends Disposable implements IViewModel {
230232
const wrappingStrategy = options.get(EditorOption.wrappingStrategy);
231233
const wrappingInfo = options.get(EditorOption.wrappingInfo);
232234
const wrappingIndent = options.get(EditorOption.wrappingIndent);
235+
const wordBreak = options.get(EditorOption.wordBreak);
233236

234-
if (this._lines.setWrappingSettings(fontInfo, wrappingStrategy, wrappingInfo.wrappingColumn, wrappingIndent)) {
237+
if (this._lines.setWrappingSettings(fontInfo, wrappingStrategy, wrappingInfo.wrappingColumn, wrappingIndent, wordBreak)) {
235238
eventsCollector.emitViewEvent(new viewEvents.ViewFlushedEvent());
236239
eventsCollector.emitViewEvent(new viewEvents.ViewLineMappingChangedEvent());
237240
eventsCollector.emitViewEvent(new viewEvents.ViewDecorationsChangedEvent(null));

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { ICoordinatesConverter, ViewLineData } from 'vs/editor/common/viewModel'
2222
export interface IViewModelLines extends IDisposable {
2323
createCoordinatesConverter(): ICoordinatesConverter;
2424

25-
setWrappingSettings(fontInfo: FontInfo, wrappingStrategy: 'simple' | 'advanced', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean;
25+
setWrappingSettings(fontInfo: FontInfo, wrappingStrategy: 'simple' | 'advanced', wrappingColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll'): boolean;
2626
setTabSize(newTabSize: number): boolean;
2727
getHiddenAreas(): Range[];
2828
setHiddenAreas(_ranges: readonly Range[]): boolean;
@@ -69,6 +69,7 @@ export class ViewModelLinesFromProjectedModel implements IViewModelLines {
6969
private tabSize: number;
7070
private wrappingColumn: number;
7171
private wrappingIndent: WrappingIndent;
72+
private wordBreak: 'normal' | 'keepAll';
7273
private wrappingStrategy: 'simple' | 'advanced';
7374

7475
private modelLineProjections!: IModelLineProjection[];
@@ -90,6 +91,7 @@ export class ViewModelLinesFromProjectedModel implements IViewModelLines {
9091
wrappingStrategy: 'simple' | 'advanced',
9192
wrappingColumn: number,
9293
wrappingIndent: WrappingIndent,
94+
wordBreak: 'normal' | 'keepAll'
9395
) {
9496
this._editorId = editorId;
9597
this.model = model;
@@ -101,6 +103,7 @@ export class ViewModelLinesFromProjectedModel implements IViewModelLines {
101103
this.wrappingStrategy = wrappingStrategy;
102104
this.wrappingColumn = wrappingColumn;
103105
this.wrappingIndent = wrappingIndent;
106+
this.wordBreak = wordBreak;
104107

105108
this._constructLines(/*resetHiddenAreas*/true, null);
106109
}
@@ -269,21 +272,23 @@ export class ViewModelLinesFromProjectedModel implements IViewModelLines {
269272
return true;
270273
}
271274

272-
public setWrappingSettings(fontInfo: FontInfo, wrappingStrategy: 'simple' | 'advanced', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean {
275+
public setWrappingSettings(fontInfo: FontInfo, wrappingStrategy: 'simple' | 'advanced', wrappingColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll'): boolean {
273276
const equalFontInfo = this.fontInfo.equals(fontInfo);
274277
const equalWrappingStrategy = (this.wrappingStrategy === wrappingStrategy);
275278
const equalWrappingColumn = (this.wrappingColumn === wrappingColumn);
276279
const equalWrappingIndent = (this.wrappingIndent === wrappingIndent);
277-
if (equalFontInfo && equalWrappingStrategy && equalWrappingColumn && equalWrappingIndent) {
280+
const equalWordBreak = (this.wordBreak === wordBreak);
281+
if (equalFontInfo && equalWrappingStrategy && equalWrappingColumn && equalWrappingIndent && equalWordBreak) {
278282
return false;
279283
}
280284

281-
const onlyWrappingColumnChanged = (equalFontInfo && equalWrappingStrategy && !equalWrappingColumn && equalWrappingIndent);
285+
const onlyWrappingColumnChanged = (equalFontInfo && equalWrappingStrategy && !equalWrappingColumn && equalWrappingIndent && equalWordBreak);
282286

283287
this.fontInfo = fontInfo;
284288
this.wrappingStrategy = wrappingStrategy;
285289
this.wrappingColumn = wrappingColumn;
286290
this.wrappingIndent = wrappingIndent;
291+
this.wordBreak = wordBreak;
287292

288293
let previousLineBreaks: ((ModelLineProjectionData | null)[]) | null = null;
289294
if (onlyWrappingColumnChanged) {
@@ -304,7 +309,7 @@ export class ViewModelLinesFromProjectedModel implements IViewModelLines {
304309
? this._domLineBreaksComputerFactory
305310
: this._monospaceLineBreaksComputerFactory
306311
);
307-
return lineBreaksComputerFactory.createLineBreaksComputer(this.fontInfo, this.tabSize, this.wrappingColumn, this.wrappingIndent);
312+
return lineBreaksComputerFactory.createLineBreaksComputer(this.fontInfo, this.tabSize, this.wrappingColumn, this.wrappingIndent, this.wordBreak);
308313
}
309314

310315
public onModelFlushed(): void {

src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ suite('Editor ViewModel - SplitLinesCollection', () => {
9696
const wordWrapBreakAfterCharacters = config.options.get(EditorOption.wordWrapBreakAfterCharacters);
9797
const wordWrapBreakBeforeCharacters = config.options.get(EditorOption.wordWrapBreakBeforeCharacters);
9898
const wrappingIndent = config.options.get(EditorOption.wrappingIndent);
99-
99+
const wordBreak = config.options.get(EditorOption.wordBreak);
100100
const lineBreaksComputerFactory = new MonospaceLineBreaksComputerFactory(wordWrapBreakBeforeCharacters, wordWrapBreakAfterCharacters);
101101

102102
const model = createTextModel([
@@ -117,7 +117,8 @@ suite('Editor ViewModel - SplitLinesCollection', () => {
117117
model.getOptions().tabSize,
118118
'simple',
119119
wrappingInfo.wrappingColumn,
120-
wrappingIndent
120+
wrappingIndent,
121+
wordBreak
121122
);
122123

123124
callback(model, linesCollection);
@@ -949,6 +950,7 @@ suite('SplitLinesCollection', () => {
949950
const wordWrapBreakAfterCharacters = configuration.options.get(EditorOption.wordWrapBreakAfterCharacters);
950951
const wordWrapBreakBeforeCharacters = configuration.options.get(EditorOption.wordWrapBreakBeforeCharacters);
951952
const wrappingIndent = configuration.options.get(EditorOption.wrappingIndent);
953+
const wordBreak = configuration.options.get(EditorOption.wordBreak);
952954

953955
const lineBreaksComputerFactory = new MonospaceLineBreaksComputerFactory(wordWrapBreakBeforeCharacters, wordWrapBreakAfterCharacters);
954956

@@ -961,7 +963,8 @@ suite('SplitLinesCollection', () => {
961963
model.getOptions().tabSize,
962964
'simple',
963965
wrappingInfo.wrappingColumn,
964-
wrappingIndent
966+
wrappingIndent,
967+
wordBreak
965968
);
966969

967970
callback(linesCollection);

0 commit comments

Comments
 (0)