Create terminal.buffer convenience attribute

This commit is contained in:
Paris Kasidiaris
2017-07-16 03:47:15 +03:00
committed by Paris Kasidiaris
parent 95cb6f30bb
commit 8ede1fc9d2
5 changed files with 84 additions and 69 deletions
+6 -2
View File
@@ -4,13 +4,15 @@
import { ITerminal } from './Interfaces';
import { Buffer } from './Buffer';
import { EventEmitter } from './EventEmitter';
export class BufferSet {
export class BufferSet extends EventEmitter {
private _normal: Buffer;
private _alt: Buffer;
private _activeBuffer: Buffer;
constructor(private _terminal: ITerminal) {
super();
this._normal = new Buffer(this._terminal);
this._alt = new Buffer(this._terminal);
this._activeBuffer = this._normal;
@@ -36,9 +38,11 @@ export class BufferSet {
public activateNormalBuffer(): void {
this._activeBuffer = this._normal;
this.emit('activate', this._normal);
}
public activateAltBuffer(): void {
this._activeBuffer = this._normal;
this._activeBuffer = this._alt;
this.emit('activate', this._alt);
}
}