File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,12 @@ export class Viewport extends Disposable {
9494 } ) ) ;
9595
9696 this . _register ( this . _bufferService . onResize ( ( ) => this . queueSync ( ) ) ) ;
97- this . _register ( this . _bufferService . buffers . onBufferActivate ( ( ) => this . queueSync ( ) ) ) ;
97+ this . _register ( this . _bufferService . buffers . onBufferActivate ( ( ) => {
98+ // Reset _latestYDisp when switching buffers to prevent stale scroll position
99+ // from alt buffer contaminating normal buffer scroll position
100+ this . _latestYDisp = undefined ;
101+ this . queueSync ( ) ;
102+ } ) ) ;
98103 this . _register ( this . _bufferService . onScroll ( ( ) => this . _sync ( ) ) ) ;
99104
100105 this . _register ( this . _scrollableElement . onScroll ( e => this . _handleScroll ( e ) ) ) ;
@@ -157,7 +162,7 @@ export class Viewport extends Disposable {
157162 } ) ;
158163 this . _suppressOnScrollHandler = false ;
159164
160- // If ydisp has been changed by some other copmonent (input/buffer), then stop animating smooth
165+ // If ydisp has been changed by some other component (input/buffer), then stop animating smooth
161166 // scroll and scroll there immediately.
162167 if ( ydisp !== this . _latestYDisp ) {
163168 this . _scrollableElement . setScrollPosition ( {
You can’t perform that action at this time.
0 commit comments