diff options
author | aiday-mar <t-aidaym@microsoft.com> | 2022-07-27 00:45:05 +0300 |
---|---|---|
committer | aiday-mar <t-aidaym@microsoft.com> | 2022-07-27 00:45:05 +0300 |
commit | 15229f184a1bbc62d8c31a392a5d4793e0d910b9 (patch) | |
tree | cd6f7d7d9742084b02a39f36441cea227c527b63 /src/vs | |
parent | 338313d5df49950a520a5e83fa309ac71a60b5d2 (diff) |
OnModelChange need to empty the stickyScrollWidget before rendering after a delay of 500 ms
Diffstat (limited to 'src/vs')
-rw-r--r-- | src/vs/editor/contrib/stickyScroll/browser/stickyScroll.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.ts index 27c578e8026..3a742f81246 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.ts @@ -61,7 +61,7 @@ class StickyScrollController implements IEditorContribution { return; } else { this._editor.addOverlayWidget(this.stickyScrollWidget); - this._sessionStore.add(this._editor.onDidChangeModel(() => setTimeout(() => this._update(true), 500))); + this._sessionStore.add(this._editor.onDidChangeModel(() => this.onModelChange())); this._sessionStore.add(this._editor.onDidScrollChange(() => this._update(false))); this._sessionStore.add(this._editor.onDidChangeModelContent(() => setTimeout(() => this._update(true), 500))); this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(() => setTimeout(() => this._update(true), 500))); @@ -69,6 +69,11 @@ class StickyScrollController implements IEditorContribution { } } + private onModelChange() { + this.stickyScrollWidget.emptyRootNode(); + setTimeout(() => this._update(true), 500); + } + private async _update(updateOutline: boolean = false): Promise<void> { if (updateOutline) { this._cts?.dispose(true); |