File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-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 ) ) ) ;
@@ -160,7 +165,6 @@ export class Viewport extends Disposable {
160165 // 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 ) {
163- this . _latestYDisp = ydisp ;
164168 this . _scrollableElement . setScrollPosition ( {
165169 scrollTop : ydisp * this . _renderService . dimensions . css . cell . height
166170 } ) ;
You can’t perform that action at this time.
0 commit comments