@@ -26,6 +26,7 @@ import { ILanguageConfigurationService } from 'vs/editor/common/languages/langua
26
26
import { ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce' ;
27
27
import * as dom from 'vs/base/browser/dom' ;
28
28
import { StickyRange } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollElement' ;
29
+ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService' ;
29
30
30
31
interface CustomMouseEvent {
31
32
detail : string ;
@@ -76,7 +77,8 @@ export class StickyScrollController extends Disposable implements IEditorContrib
76
77
@IInstantiationService private readonly _instaService : IInstantiationService ,
77
78
@ILanguageConfigurationService _languageConfigurationService : ILanguageConfigurationService ,
78
79
@ILanguageFeatureDebounceService _languageFeatureDebounceService : ILanguageFeatureDebounceService ,
79
- @IContextKeyService private readonly _contextKeyService : IContextKeyService
80
+ @IContextKeyService private readonly _contextKeyService : IContextKeyService ,
81
+ @ICodeEditorService private readonly _codeEditorService : ICodeEditorService
80
82
) {
81
83
super ( ) ;
82
84
this . _stickyScrollWidget = new StickyScrollWidget ( this . _editor ) ;
@@ -297,15 +299,32 @@ export class StickyScrollController extends Disposable implements IEditorContrib
297
299
} ) ;
298
300
}
299
301
302
+ private _removeStickyWidget ( ) : void {
303
+ this . _editor . removeOverlayWidget ( this . _stickyScrollWidget ) ;
304
+ this . _sessionStore . clear ( ) ;
305
+ this . _enabled = false ;
306
+ }
307
+
300
308
private _readConfiguration ( ) {
301
309
const options = this . _editor . getOption ( EditorOption . stickyScroll ) ;
302
310
303
311
if ( options . enabled === false ) {
304
- this . _editor . removeOverlayWidget ( this . _stickyScrollWidget ) ;
305
- this . _sessionStore . clear ( ) ;
306
- this . _enabled = false ;
312
+ this . _removeStickyWidget ( ) ;
307
313
return ;
308
314
} else if ( options . enabled && ! this . _enabled ) {
315
+ // Do not render the sticky scroll if the editor is the left side of an inline diff editor
316
+ let isLeftSideOfInlineDiffEditor = false ;
317
+ if ( this . _editor . getOption ( EditorOption . inDiffEditor ) ) {
318
+ for ( const diffEditor of this . _codeEditorService . listDiffEditors ( ) ) {
319
+ if ( diffEditor . getOriginalEditor ( ) === this . _editor && ! diffEditor . renderSideBySide ) {
320
+ isLeftSideOfInlineDiffEditor = true ;
321
+ }
322
+ }
323
+ }
324
+ if ( isLeftSideOfInlineDiffEditor ) {
325
+ this . _removeStickyWidget ( ) ;
326
+ return ;
327
+ }
309
328
// When sticky scroll was just enabled, add the listeners on the sticky scroll
310
329
this . _editor . addOverlayWidget ( this . _stickyScrollWidget ) ;
311
330
this . _sessionStore . add ( this . _editor . onDidScrollChange ( ( ) => this . _renderStickyScroll ( ) ) ) ;
0 commit comments