@@ -26,7 +26,6 @@ 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' ;
30
29
31
30
interface CustomMouseEvent {
32
31
detail : string ;
@@ -77,8 +76,7 @@ export class StickyScrollController extends Disposable implements IEditorContrib
77
76
@IInstantiationService private readonly _instaService : IInstantiationService ,
78
77
@ILanguageConfigurationService _languageConfigurationService : ILanguageConfigurationService ,
79
78
@ILanguageFeatureDebounceService _languageFeatureDebounceService : ILanguageFeatureDebounceService ,
80
- @IContextKeyService private readonly _contextKeyService : IContextKeyService ,
81
- @ICodeEditorService private readonly _codeEditorService : ICodeEditorService
79
+ @IContextKeyService private readonly _contextKeyService : IContextKeyService
82
80
) {
83
81
super ( ) ;
84
82
this . _stickyScrollWidget = new StickyScrollWidget ( this . _editor ) ;
@@ -299,32 +297,15 @@ export class StickyScrollController extends Disposable implements IEditorContrib
299
297
} ) ;
300
298
}
301
299
302
- private _removeStickyWidget ( ) : void {
303
- this . _editor . removeOverlayWidget ( this . _stickyScrollWidget ) ;
304
- this . _sessionStore . clear ( ) ;
305
- this . _enabled = false ;
306
- }
307
-
308
300
private _readConfiguration ( ) {
309
301
const options = this . _editor . getOption ( EditorOption . stickyScroll ) ;
310
302
311
303
if ( options . enabled === false ) {
312
- this . _removeStickyWidget ( ) ;
304
+ this . _editor . removeOverlayWidget ( this . _stickyScrollWidget ) ;
305
+ this . _sessionStore . clear ( ) ;
306
+ this . _enabled = false ;
313
307
return ;
314
308
} 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
- }
328
309
// When sticky scroll was just enabled, add the listeners on the sticky scroll
329
310
this . _editor . addOverlayWidget ( this . _stickyScrollWidget ) ;
330
311
this . _sessionStore . add ( this . _editor . onDidScrollChange ( ( ) => this . _renderStickyScroll ( ) ) ) ;
0 commit comments