Skip to content

Commit da39129

Browse files
committed
Revert "Make sure all rows are refreshed on input"
This reverts commit 973eb7b.
1 parent 973eb7b commit da39129

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/browser/Viewport.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export class Viewport extends Disposable implements IViewport {
3030
private _wheelPartialScroll: number = 0;
3131

3232
private _refreshAnimationFrame: number | null = null;
33+
private _ignoreNextScrollEvent: boolean = false;
3334

3435
constructor(
3536
private readonly _scrollLines: (amount: number) => void,
@@ -87,12 +88,14 @@ export class Viewport extends Disposable implements IViewport {
8788
// Sync scrollTop
8889
const scrollTop = this._bufferService.buffer.ydisp * this._currentRowHeight;
8990
if (this._viewportElement.scrollTop !== scrollTop) {
91+
// Ignore the next scroll event which will be triggered by setting the scrollTop as we do not
92+
// want this event to scroll the terminal
93+
this._ignoreNextScrollEvent = true;
9094
this._viewportElement.scrollTop = scrollTop;
9195
}
9296

9397
this._refreshAnimationFrame = null;
9498
}
95-
9699
/**
97100
* Updates dimensions and synchronizes the scroll area if necessary.
98101
*/
@@ -145,6 +148,12 @@ export class Viewport extends Disposable implements IViewport {
145148
return;
146149
}
147150

151+
// Ignore the event if it was flagged to ignore (when the source of the event is from Viewport)
152+
if (this._ignoreNextScrollEvent) {
153+
this._ignoreNextScrollEvent = false;
154+
return;
155+
}
156+
148157
const newRow = Math.round(this._lastScrollTop / this._currentRowHeight);
149158
const diff = newRow - this._bufferService.buffer.ydisp;
150159
this._scrollLines(diff);

0 commit comments

Comments
 (0)