File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
src/vs/editor/contrib/stickyScroll/browser Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -112,12 +112,11 @@ export class StickyScrollController extends Disposable implements IEditorContrib
112
112
return ;
113
113
}
114
114
const model = this . _editor . getModel ( ) ;
115
- if ( this . _stickyLineCandidateProvider . getVersionId ( ) !== model . getVersionId ( ) ) {
116
- // Old _ranges not updated yet
117
- return ;
115
+ const stickyLineVersion = this . _stickyLineCandidateProvider . getVersionId ( ) ;
116
+ if ( stickyLineVersion === undefined || stickyLineVersion === model . getVersionId ( ) ) {
117
+ this . _widgetState = this . getScrollWidgetState ( ) ;
118
+ this . _stickyScrollWidget . setState ( this . _widgetState ) ;
118
119
}
119
- this . _widgetState = this . getScrollWidgetState ( ) ;
120
- this . _stickyScrollWidget . setState ( this . _widgetState ) ;
121
120
}
122
121
123
122
public getScrollWidgetState ( ) : StickyScrollWidgetState {
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export class StickyLineCandidateProvider extends Disposable {
91
91
}
92
92
93
93
public getVersionId ( ) {
94
- return this . _model ?. version ?? - 1 ;
94
+ return this . _model ?. version ;
95
95
}
96
96
97
97
public async update ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments