@@ -109,7 +109,7 @@ export interface ISplitLine {
109109export interface IViewModelLinesCollection extends IDisposable {
110110 createCoordinatesConverter ( ) : ICoordinatesConverter ;
111111
112- setWrappingSettings ( fontInfo : FontInfo , wrappingColumn : number , wrappingIndent : WrappingIndent ) : boolean ;
112+ setWrappingSettings ( fontInfo : FontInfo , wrappingAlgorithm : 'monospace' | 'dom' , wrappingColumn : number , wrappingIndent : WrappingIndent ) : boolean ;
113113 setTabSize ( newTabSize : number ) : boolean ;
114114 getHiddenAreas ( ) : Range [ ] ;
115115 setHiddenAreas ( _ranges : Range [ ] ) : boolean ;
@@ -265,8 +265,6 @@ class LineNumberMapper {
265265 }
266266}
267267
268- const usDOMLineBreaksComputerFactory = false ;
269-
270268export class SplitLinesCollection implements IViewModelLinesCollection {
271269
272270 private readonly model : ITextModel ;
@@ -279,6 +277,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
279277 private tabSize : number ;
280278 private wrappingColumn : number ;
281279 private wrappingIndent : WrappingIndent ;
280+ private wrappingAlgorithm : 'monospace' | 'dom' ;
282281 private lines ! : ISplitLine [ ] ;
283282
284283 private prefixSumComputer ! : LineNumberMapper ;
@@ -291,15 +290,17 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
291290 monospaceLineBreaksComputerFactory : ILineBreaksComputerFactory ,
292291 fontInfo : FontInfo ,
293292 tabSize : number ,
293+ wrappingAlgorithm : 'monospace' | 'dom' ,
294294 wrappingColumn : number ,
295- wrappingIndent : WrappingIndent
295+ wrappingIndent : WrappingIndent ,
296296 ) {
297297 this . model = model ;
298298 this . _validModelVersionId = - 1 ;
299299 this . _domLineBreaksComputerFactory = domLineBreaksComputerFactory ;
300300 this . _monospaceLineBreaksComputerFactory = monospaceLineBreaksComputerFactory ;
301301 this . fontInfo = fontInfo ;
302302 this . tabSize = tabSize ;
303+ this . wrappingAlgorithm = wrappingAlgorithm ;
303304 this . wrappingColumn = wrappingColumn ;
304305 this . wrappingIndent = wrappingIndent ;
305306
@@ -483,17 +484,19 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
483484 return true ;
484485 }
485486
486- public setWrappingSettings ( fontInfo : FontInfo , wrappingColumn : number , wrappingIndent : WrappingIndent ) : boolean {
487+ public setWrappingSettings ( fontInfo : FontInfo , wrappingAlgorithm : 'monospace' | 'dom' , wrappingColumn : number , wrappingIndent : WrappingIndent ) : boolean {
487488 const equalFontInfo = this . fontInfo . equals ( fontInfo ) ;
489+ const equalWrappingAlgorithm = ( this . wrappingAlgorithm === wrappingAlgorithm ) ;
488490 const equalWrappingColumn = ( this . wrappingColumn === wrappingColumn ) ;
489491 const equalWrappingIndent = ( this . wrappingIndent === wrappingIndent ) ;
490- if ( equalFontInfo && equalWrappingColumn && equalWrappingIndent ) {
492+ if ( equalFontInfo && equalWrappingAlgorithm && equalWrappingColumn && equalWrappingIndent ) {
491493 return false ;
492494 }
493495
494- const onlyWrappingColumnChanged = ( equalFontInfo && ! equalWrappingColumn && equalWrappingIndent ) ;
496+ const onlyWrappingColumnChanged = ( equalFontInfo && equalWrappingAlgorithm && ! equalWrappingColumn && equalWrappingIndent ) ;
495497
496498 this . fontInfo = fontInfo ;
499+ this . wrappingAlgorithm = wrappingAlgorithm ;
497500 this . wrappingColumn = wrappingColumn ;
498501 this . wrappingIndent = wrappingIndent ;
499502
@@ -512,7 +515,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
512515
513516 public createLineBreaksComputer ( ) : ILineBreaksComputer {
514517 const lineBreaksComputerFactory = (
515- usDOMLineBreaksComputerFactory
518+ this . wrappingAlgorithm === 'dom'
516519 ? this . _domLineBreaksComputerFactory
517520 : this . _monospaceLineBreaksComputerFactory
518521 ) ;
@@ -1457,7 +1460,7 @@ export class IdentityLinesCollection implements IViewModelLinesCollection {
14571460 return false ;
14581461 }
14591462
1460- public setWrappingSettings ( _fontInfo : FontInfo , _wrappingColumn : number , _wrappingIndent : WrappingIndent ) : boolean {
1463+ public setWrappingSettings ( _fontInfo : FontInfo , _wrappingAlgorithm : 'monospace' | 'dom' , _wrappingColumn : number , _wrappingIndent : WrappingIndent ) : boolean {
14611464 return false ;
14621465 }
14631466
0 commit comments