@@ -19,6 +19,7 @@ import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations';
1919import { RunOnceScheduler } from 'vs/base/common/async' ;
2020import { IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents' ;
2121import { Position } from 'vs/editor/common/core/position' ;
22+ import { Range } from 'vs/editor/common/core/range' ;
2223
2324class StickyScrollController extends Disposable implements IEditorContribution {
2425
@@ -61,6 +62,7 @@ class StickyScrollController extends Disposable implements IEditorContribution {
6162 this . _editor . addOverlayWidget ( this . stickyScrollWidget ) ;
6263 this . _sessionStore . add ( this . _editor . onDidChangeModel ( ( ) => this . _update ( true ) ) ) ;
6364 this . _sessionStore . add ( this . _editor . onDidScrollChange ( ( ) => this . _update ( false ) ) ) ;
65+ this . _sessionStore . add ( this . _editor . onDidChangeHiddenAreas ( ( ) => this . _update ( true ) ) ) ;
6466 this . _sessionStore . add ( this . _editor . onDidChangeModelTokens ( ( e ) => this . _onTokensChange ( e ) ) ) ;
6567 this . _sessionStore . add ( this . _editor . onDidChangeModelContent ( ( ) => this . _updateSoon . schedule ( ) ) ) ;
6668 this . _sessionStore . add ( this . _languageFeaturesService . documentSymbolProvider . onDidChange ( ( ) => this . _update ( true ) ) ) ;
@@ -92,6 +94,12 @@ class StickyScrollController extends Disposable implements IEditorContribution {
9294 this . _cts = new CancellationTokenSource ( ) ;
9395 await this . _updateOutlineModel ( this . _cts . token ) ;
9496 }
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+ }
95103 this . _renderStickyScroll ( ) ;
96104 }
97105
0 commit comments