diff --git a/core/view.js b/core/view.js index 6937d5b7..675b8187 100644 --- a/core/view.js +++ b/core/view.js @@ -146,11 +146,17 @@ View.prototype.setDimension = function(dimens) { }; View.prototype.setHeight = function(height) { + assert(_.isNumber(height)); + // :TODO: assert height is within this.client.term.termHeight + this.dimens.height = height; this.autoScale.height = false; }; View.prototype.setWidth = function(width) { + assert(_.isNumber(width)); + // :TODO: assert width is appropriate for this.client.term.termWidth + this.dimens.width = width; this.autoScale.width = false; }; @@ -168,6 +174,21 @@ View.prototype.getFocusSGR = function() { return this.ansiFocusSGR; }; +View.prototype.setProperty = function(propName, value) { + switch(propName) { + case 'height' : this.setHeight(value); break; + case 'width' : this.setWidth(value); break; + case 'focus' : this.setFocus(value); break; + } + + // :TODO: setStyleSGRx() + /* + if(/styleSGR[0-9]+/.test(propName)) { + this.styleSGR + } + */ +}; + View.prototype.redraw = function() { this.client.term.write(ansi.goto(this.position.row, this.position.col)); };