Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/browser/Viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ export class Viewport extends Disposable {
}));

this._register(this._bufferService.onResize(() => this.queueSync()));
this._register(this._bufferService.buffers.onBufferActivate(() => this.queueSync()));
this._register(this._bufferService.buffers.onBufferActivate(() => {
// Reset _latestYDisp when switching buffers to prevent stale scroll position
// from alt buffer contaminating normal buffer scroll position
this._latestYDisp = undefined;
this.queueSync();
}));
this._register(this._bufferService.onScroll(() => this._sync()));

this._register(this._scrollableElement.onScroll(e => this._handleScroll(e)));
Expand Down Expand Up @@ -157,7 +162,7 @@ export class Viewport extends Disposable {
});
this._suppressOnScrollHandler = false;

// If ydisp has been changed by some other copmonent (input/buffer), then stop animating smooth
// If ydisp has been changed by some other component (input/buffer), then stop animating smooth
// scroll and scroll there immediately.
if (ydisp !== this._latestYDisp) {
this._scrollableElement.setScrollPosition({
Expand Down
Loading