diff --git a/lib/widget.js b/lib/widget.js index a7160ea..70a04c9 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -534,16 +534,17 @@ Screen.prototype.__defineGetter__('height', function() { }); Screen.prototype.alloc = function() { - this.program.clear(); var x, y; + this.lines = []; for (y = 0; y < this.rows; y++) { this.lines[y] = []; for (x = 0; x < this.cols; x++) { this.lines[y][x] = [this.dattr, ' ']; } - this.lines[y].dirty = true; + this.lines[y].dirty = false; } + this.olines = []; for (y = 0; y < this.rows; y++) { this.olines[y] = []; @@ -551,6 +552,8 @@ Screen.prototype.alloc = function() { this.olines[y][x] = [this.dattr, ' ']; } } + + this.program.clear(); }; Screen.prototype.render = function() {