Skip to content

Commit 01fc0c9

Browse files
authored
Early return only when rebuildFromIndexCandidate is undefined too (#252396)
early return when we dont have to rebuild
1 parent 304c07e commit 01fc0c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
146146
setState(state: StickyScrollWidgetState | undefined, foldingModel: FoldingModel | undefined, rebuildFromIndexCandidate?: number): void {
147147
const currentStateAndPreviousStateUndefined = !this._state && !state;
148148
const currentStateDefinedAndEqualsPreviousState = this._state && this._state.equals(state);
149-
if (currentStateAndPreviousStateUndefined || currentStateDefinedAndEqualsPreviousState) {
149+
if (rebuildFromIndexCandidate === undefined && (currentStateAndPreviousStateUndefined || currentStateDefinedAndEqualsPreviousState)) {
150150
return;
151151
}
152152
const data = this._findRenderingData(state);

0 commit comments

Comments
 (0)