Merge pull request #5390 from xtermjs/anthonykim1/fixTeleportAltBuffer
Fix scrollbar teleport after exiting alt buffer
This commit is contained in:
@@ -20,6 +20,7 @@ export class MockBufferService implements IBufferService {
|
|||||||
public buffers: IBufferSet = {} as any;
|
public buffers: IBufferSet = {} as any;
|
||||||
public onResize: Event<{ cols: number, rows: number }> = new Emitter<{ cols: number, rows: number }>().event;
|
public onResize: Event<{ cols: number, rows: number }> = new Emitter<{ cols: number, rows: number }>().event;
|
||||||
public onScroll: Event<number> = new Emitter<number>().event;
|
public onScroll: Event<number> = new Emitter<number>().event;
|
||||||
|
private readonly _onScroll = new Emitter<number>();
|
||||||
public isUserScrolling: boolean = false;
|
public isUserScrolling: boolean = false;
|
||||||
constructor(
|
constructor(
|
||||||
public cols: number,
|
public cols: number,
|
||||||
@@ -27,6 +28,10 @@ export class MockBufferService implements IBufferService {
|
|||||||
optionsService: IOptionsService = new MockOptionsService()
|
optionsService: IOptionsService = new MockOptionsService()
|
||||||
) {
|
) {
|
||||||
this.buffers = new BufferSet(optionsService, this);
|
this.buffers = new BufferSet(optionsService, this);
|
||||||
|
// Listen to buffer activation events and automatically fire scroll events
|
||||||
|
this.buffers.onBufferActivate(e => {
|
||||||
|
this._onScroll.fire(e.activeBuffer.ydisp);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
public scrollPages(pageCount: number): void {
|
public scrollPages(pageCount: number): void {
|
||||||
throw new Error('Method not implemented.');
|
throw new Error('Method not implemented.');
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ export class BufferService extends Disposable implements IBufferService {
|
|||||||
this.cols = Math.max(optionsService.rawOptions.cols || 0, MINIMUM_COLS);
|
this.cols = Math.max(optionsService.rawOptions.cols || 0, MINIMUM_COLS);
|
||||||
this.rows = Math.max(optionsService.rawOptions.rows || 0, MINIMUM_ROWS);
|
this.rows = Math.max(optionsService.rawOptions.rows || 0, MINIMUM_ROWS);
|
||||||
this.buffers = this._register(new BufferSet(optionsService, this));
|
this.buffers = this._register(new BufferSet(optionsService, this));
|
||||||
|
this._register(this.buffers.onBufferActivate(e => {
|
||||||
|
this._onScroll.fire(e.activeBuffer.ydisp);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
public resize(cols: number, rows: number): void {
|
public resize(cols: number, rows: number): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user