* Some code cleanup

* Lots of notes/thoughts
This commit is contained in:
Bryan Ashby 2015-04-30 22:29:24 -06:00
parent e8346779da
commit 3f92a7949d
6 changed files with 157 additions and 41 deletions

View file

@ -56,13 +56,20 @@ function View(options) {
}
// :TODO: Don't allow width/height > client.term
if(options.dimens && options.dimens.height) {
this.dimens.height = options.dimens.height;
if(_.isObject(options.dimens)) {
if(_.isNumber(options.dimens.height)) {
this.dimens.height = options.dimens.height;
}
if(_.isNumber(options.dimens.width)) {
this.dimens.width = options.dimens.width;
}
} else {
options.dimens = { width : 1, height : 1 };
}
if(options.dimens && options.dimens.width) {
this.dimens.width = options.dimens.width;
}
options.dimens.width = options.dimens.width || 1;
options.dimens.height = options.dimens.height || 1;
this.ansiSGR = options.ansiSGR || ansi.getSGRFromGraphicRendition( { fg : 39, bg : 49 }, true);
this.ansiFocusSGR = options.ansiFocusSGR || this.ansiSGR;