@@ -19,6 +19,7 @@ import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations';
19
19
import { RunOnceScheduler } from 'vs/base/common/async' ;
20
20
import { IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents' ;
21
21
import { Position } from 'vs/editor/common/core/position' ;
22
+ import { Range } from 'vs/editor/common/core/range' ;
22
23
23
24
class StickyScrollController extends Disposable implements IEditorContribution {
24
25
@@ -61,6 +62,7 @@ class StickyScrollController extends Disposable implements IEditorContribution {
61
62
this . _editor . addOverlayWidget ( this . stickyScrollWidget ) ;
62
63
this . _sessionStore . add ( this . _editor . onDidChangeModel ( ( ) => this . _update ( true ) ) ) ;
63
64
this . _sessionStore . add ( this . _editor . onDidScrollChange ( ( ) => this . _update ( false ) ) ) ;
65
+ this . _sessionStore . add ( this . _editor . onDidChangeHiddenAreas ( ( ) => this . _update ( true ) ) ) ;
64
66
this . _sessionStore . add ( this . _editor . onDidChangeModelTokens ( ( e ) => this . _onTokensChange ( e ) ) ) ;
65
67
this . _sessionStore . add ( this . _editor . onDidChangeModelContent ( ( ) => this . _updateSoon . schedule ( ) ) ) ;
66
68
this . _sessionStore . add ( this . _languageFeaturesService . documentSymbolProvider . onDidChange ( ( ) => this . _update ( true ) ) ) ;
@@ -92,6 +94,12 @@ class StickyScrollController extends Disposable implements IEditorContribution {
92
94
this . _cts = new CancellationTokenSource ( ) ;
93
95
await this . _updateOutlineModel ( this . _cts . token ) ;
94
96
}
97
+ const hiddenRanges : Range [ ] | undefined = this . _editor . _getViewModel ( ) ?. getHiddenAreas ( ) ;
98
+ if ( hiddenRanges ) {
99
+ for ( const hiddenRange of hiddenRanges ) {
100
+ this . _ranges = this . _ranges . filter ( range => { return ! ( range [ 0 ] >= hiddenRange . startLineNumber && range [ 1 ] <= hiddenRange . endLineNumber + 1 ) ; } ) ;
101
+ }
102
+ }
95
103
this . _renderStickyScroll ( ) ;
96
104
}
97
105
0 commit comments