File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
src/vs/editor/browser/widget/diffEditorWidget2 Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -335,8 +335,21 @@ export class ViewZoneManager extends Disposable {
335
335
scrollState . restore ( this . _modifiedEditor ) ;
336
336
} ) ) ;
337
337
338
- this . _register ( this . _originalEditor . onDidScrollChange ( e => { this . _modifiedEditor . setScrollLeft ( e . scrollLeft ) ; } ) ) ;
339
- this . _register ( this . _modifiedEditor . onDidScrollChange ( e => { this . _originalEditor . setScrollLeft ( e . scrollLeft ) ; } ) ) ;
338
+ let ignoreChange = false ;
339
+ this . _register ( this . _originalEditor . onDidScrollChange ( e => {
340
+ if ( e . scrollLeftChanged && ! ignoreChange ) {
341
+ ignoreChange = true ;
342
+ this . _modifiedEditor . setScrollLeft ( e . scrollLeft ) ;
343
+ ignoreChange = false ;
344
+ }
345
+ } ) ) ;
346
+ this . _register ( this . _modifiedEditor . onDidScrollChange ( e => {
347
+ if ( e . scrollLeftChanged && ! ignoreChange ) {
348
+ ignoreChange = true ;
349
+ this . _originalEditor . setScrollLeft ( e . scrollLeft ) ;
350
+ ignoreChange = false ;
351
+ }
352
+ } ) ) ;
340
353
341
354
this . _originalScrollTop = observableFromEvent ( this . _originalEditor . onDidScrollChange , ( ) => this . _originalEditor . getScrollTop ( ) ) ;
342
355
this . _modifiedScrollTop = observableFromEvent ( this . _modifiedEditor . onDidScrollChange , ( ) => this . _modifiedEditor . getScrollTop ( ) ) ;
You can’t perform that action at this time.
0 commit comments