@@ -29,7 +29,7 @@ import { OverviewRulerPart } from 'vs/editor/browser/widget/diffEditorWidget2/ov
29
29
import { UnchangedRangesFeature } from 'vs/editor/browser/widget/diffEditorWidget2/unchangedRanges' ;
30
30
import { ObservableElementSizeObserver , applyStyle , deepMerge , readHotReloadableExport } from 'vs/editor/browser/widget/diffEditorWidget2/utils' ;
31
31
import { WorkerBasedDocumentDiffProvider } from 'vs/editor/browser/widget/workerBasedDocumentDiffProvider' ;
32
- import { EditorOptions , IDiffEditorOptions , IEditorOptions , ValidDiffEditorBaseOptions , clampedFloat , clampedInt , boolean as validateBooleanOption , stringSet as validateStringSetOption } from 'vs/editor/common/config/editorOptions' ;
32
+ import { EditorOption , EditorOptions , IDiffEditorOptions , IEditorOptions , ValidDiffEditorBaseOptions , clampedFloat , clampedInt , boolean as validateBooleanOption , stringSet as validateStringSetOption } from 'vs/editor/common/config/editorOptions' ;
33
33
import { IDimension } from 'vs/editor/common/core/dimension' ;
34
34
import { Position } from 'vs/editor/common/core/position' ;
35
35
import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer' ;
@@ -87,7 +87,19 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
87
87
private readonly _boundarySashes = observableValue < IBoundarySashes | undefined > ( 'boundarySashes' , undefined ) ;
88
88
private readonly _renderOverviewRuler = derived ( 'renderOverviewRuler' , reader => this . _options . read ( reader ) . renderOverviewRuler ) ;
89
89
private readonly _renderSideBySide = derived ( 'renderSideBySide' , reader => this . _options . read ( reader ) . renderSideBySide ) ;
90
-
90
+ private readonly _shouldRenderRevertArrows = derived ( 'shouldRenderRevertArrows' , ( reader ) => {
91
+ if ( ! this . _options . read ( reader ) . renderMarginRevertIcon ) {
92
+ return false ;
93
+ }
94
+ if ( ! this . _renderSideBySide . read ( reader ) ) {
95
+ return false ;
96
+ }
97
+ this . _options . read ( reader ) ; // TODO@hediet editor options should be revisited. _options might just get partial updates.
98
+ if ( this . _modifiedEditor . getOption ( EditorOption . readOnly ) ) {
99
+ return false ;
100
+ }
101
+ return true ;
102
+ } ) ;
91
103
private unchangedRangesFeature ! : UnchangedRangesFeature ;
92
104
93
105
private readonly _reviewPane : DiffReview2 ;
@@ -154,7 +166,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
154
166
155
167
this . _register ( autorunWithStore2 ( 'decorations' , ( reader , store ) => {
156
168
store . add ( new ( readHotReloadableExport ( DiffEditorDecorations , reader ) ) (
157
- this . _originalEditor , this . _modifiedEditor , this . _diffModel , this . _renderSideBySide ,
169
+ this . _originalEditor , this . _modifiedEditor , this . _diffModel , this . _shouldRenderRevertArrows ,
158
170
) ) ;
159
171
} ) ) ;
160
172
@@ -164,6 +176,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
164
176
this . _modifiedEditor ,
165
177
this . _diffModel ,
166
178
this . _renderSideBySide ,
179
+ this . _shouldRenderRevertArrows ,
167
180
this ,
168
181
( ) => this . unchangedRangesFeature . isUpdatingViewZones ,
169
182
) ) ;
0 commit comments