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 {
20
20
public buffers : IBufferSet = { } as any ;
21
21
public onResize : Event < { cols : number , rows : number } > = new Emitter < { cols : number , rows : number } > ( ) . event ;
22
22
public onScroll : Event < number > = new Emitter < number > ( ) . event ;
23
+ private readonly _onScroll = new Emitter < number > ( ) ;
23
24
public isUserScrolling : boolean = false ;
24
25
constructor (
25
26
public cols : number ,
26
27
public rows : number ,
27
28
optionsService : IOptionsService = new MockOptionsService ( )
28
29
) {
29
30
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
+ } ) ;
30
35
}
31
36
public scrollPages ( pageCount : number ) : void {
32
37
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 {
37
37
this . cols = Math . max ( optionsService . rawOptions . cols || 0 , MINIMUM_COLS ) ;
38
38
this . rows = Math . max ( optionsService . rawOptions . rows || 0 , MINIMUM_ROWS ) ;
39
39
this . buffers = this . _register ( new BufferSet ( optionsService , this ) ) ;
40
+ this . _register ( this . buffers . onBufferActivate ( e => {
41
+ this . _onScroll . fire ( e . activeBuffer . ydisp ) ;
42
+ } ) ) ;
40
43
}
41
44
42
45
public resize ( cols : number , rows : number ) : void {
You can’t perform that action at this time.
0 commit comments