File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -277,9 +277,20 @@ export class VisibleLinesCollection<T extends IVisibleLine> {
277
277
return false ;
278
278
}
279
279
280
- public onFlushed ( e : viewEvents . ViewFlushedEvent ) : boolean {
280
+ public onFlushed ( e : viewEvents . ViewFlushedEvent , flushDom ?: boolean ) : boolean {
281
+ // No need to clear the dom node because a full .innerHTML will occur in
282
+ // ViewLayerRenderer._render, however the the fallbakc mechanism in the
283
+ // GPU renderer may cause this to be necessary as the .innerHTML call
284
+ // may not happen depending on the new state, leaving stale DOM nodes
285
+ // around.
286
+ if ( flushDom ) {
287
+ const start = this . _linesCollection . getStartLineNumber ( ) ;
288
+ const end = this . _linesCollection . getEndLineNumber ( ) ;
289
+ for ( let i = start ; i <= end ; i ++ ) {
290
+ this . _linesCollection . getLine ( i ) . getDomNode ( ) ?. remove ( ) ;
291
+ }
292
+ }
281
293
this . _linesCollection . flush ( ) ;
282
- // No need to clear the dom node because a full .innerHTML will occur in ViewLayerRenderer._render
283
294
return true ;
284
295
}
285
296
Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ export class ViewLines extends ViewPart implements IViewLines {
254
254
return true ;
255
255
}
256
256
public override onFlushed ( e : viewEvents . ViewFlushedEvent ) : boolean {
257
- const shouldRender = this . _visibleLines . onFlushed ( e ) ;
257
+ const shouldRender = this . _visibleLines . onFlushed ( e , this . _viewLineOptions . useGpu ) ;
258
258
this . _maxLineWidth = 0 ;
259
259
return shouldRender ;
260
260
}
You can’t perform that action at this time.
0 commit comments