File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/vs/editor/browser/widget/diffEditorWidget2 Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,19 @@ export class DiffModel extends Disposable implements IDiffEditorViewModel {
31
31
'unchangedRegion' ,
32
32
{ regions : [ ] , originalDecorationIds : [ ] , modifiedDecorationIds : [ ] }
33
33
) ;
34
- public readonly unchangedRegions : IObservable < UnchangedRegion [ ] > = derived ( 'unchangedRegions' , r =>
35
- this . _hideUnchangedRegions . read ( r ) ? this . _unchangedRegions . read ( r ) . regions : [ ]
34
+ public readonly unchangedRegions : IObservable < UnchangedRegion [ ] > = derived ( 'unchangedRegions' , r => {
35
+ if ( this . _hideUnchangedRegions . read ( r ) ) {
36
+ return this . _unchangedRegions . read ( r ) . regions ;
37
+ } else {
38
+ // Reset state
39
+ transaction ( tx => {
40
+ for ( const r of this . _unchangedRegions . get ( ) . regions ) {
41
+ r . setState ( 0 , 0 , tx ) ;
42
+ }
43
+ } ) ;
44
+ return [ ] ;
45
+ }
46
+ }
36
47
) ;
37
48
38
49
public readonly syncedMovedTexts = observableValue < MovedText | undefined > ( 'syncedMovedText' , undefined ) ;
You can’t perform that action at this time.
0 commit comments