File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,18 @@ export class MockBufferService implements IBufferService {
2020 public buffers : IBufferSet = { } as any ;
2121 public onResize : Event < { cols : number , rows : number } > = new Emitter < { cols : number , rows : number } > ( ) . event ;
2222 public onScroll : Event < number > = new Emitter < number > ( ) . event ;
23+ private readonly _onScroll = new Emitter < number > ( ) ;
2324 public isUserScrolling : boolean = false ;
2425 constructor (
2526 public cols : number ,
2627 public rows : number ,
2728 optionsService : IOptionsService = new MockOptionsService ( )
2829 ) {
2930 this . buffers = new BufferSet ( optionsService , this ) ;
31+ // Listen to buffer activation events and automatically fire scroll events
32+ this . buffers . onBufferActivate ( e => {
33+ this . _onScroll . fire ( e . activeBuffer . ydisp ) ;
34+ } ) ;
3035 }
3136 public scrollPages ( pageCount : number ) : void {
3237 throw new Error ( 'Method not implemented.' ) ;
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ export class BufferService extends Disposable implements IBufferService {
3737 this . cols = Math . max ( optionsService . rawOptions . cols || 0 , MINIMUM_COLS ) ;
3838 this . rows = Math . max ( optionsService . rawOptions . rows || 0 , MINIMUM_ROWS ) ;
3939 this . buffers = this . _register ( new BufferSet ( optionsService , this ) ) ;
40+ this . _register ( this . buffers . onBufferActivate ( e => {
41+ this . _onScroll . fire ( e . activeBuffer . ydisp ) ;
42+ } ) ) ;
4043 }
4144
4245 public resize ( cols : number , rows : number ) : void {
You can’t perform that action at this time.
0 commit comments