initDefaultWidht() for various views

This commit is contained in:
Bryan Ashby 2018-06-23 22:23:22 -06:00
parent 0cfd45d8a9
commit 3aa23db306
8 changed files with 16 additions and 2 deletions

View file

@ -100,6 +100,10 @@ function View(options) {
//this.client.term.write(ansi.setCursorStyle(this.cursorStyle));
this.client.term.rawWrite('show' === this.cursor ? ansi.showCursor() : ansi.hideCursor());
};
this.initDefaultWidth = function(width = 15) {
this.dimens.width = this.dimens.width || Math.min(width, this.client.term.termWidth - this.position.col);
};
}
util.inherits(View, events.EventEmitter);