From cbcc7e612485a6857dfbc6df6b5650cdf340a558 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 19 Mar 2015 04:13:44 -0700 Subject: [PATCH] temporarily remove noAlt. --- lib/widget.js | 53 -------------------------------------------- test/widget-noalt.js | 3 ++- 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/lib/widget.js b/lib/widget.js index a1035d8..758fc45 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -456,22 +456,6 @@ Screen.prototype.__defineSetter__('title', function(title) { }); Screen.prototype.enter = function() { - if (this.options.noAlt) { - if (this._entered) return; - this._entered = true; - var self = this; - this.program.saveReportedCursor(); - this.program.hideCursor(); - this.program.cup(0, 0); - this.program.csr(0, this.height - 1); - this.alloc(); - var log = console.log; - console.log = function() { - self.leave(); - return log.apply(console, arguments); - }; - return; - } if (this.program.isAlt) return; this.program.alternateBuffer(); this.program.hideCursor(); @@ -481,22 +465,6 @@ Screen.prototype.enter = function() { }; Screen.prototype.leave = function() { - if (this.options.noAlt) { - if (this._left) return; - this._left = true; - if (this.program.scrollTop !== 0 - || this.program.scrollBottom !== this.rows - 1) { - this.program.csr(0, this.height - 1); - } - this.program.restoreReportedCursor(); - this.program.nel(); - this.program.showCursor(); - if (this._listenedMouse) { - this.program.disableMouse(); - } - this.program.flush(); - return; - } if (!this.program.isAlt) return; if (this.program.scrollTop !== 0 || this.program.scrollBottom !== this.rows - 1) { @@ -713,27 +681,6 @@ Screen.prototype.alloc = function() { } } - if (this.options.noAlt) { - var self = this; - var draw = self.draw; - this.draw = function() {}; - return this.once('render', function() { - var top = -1; - self.forDescendants(function(el) { - if (!el.lpos) return; - if (top === -1 || el.lpos.yi < top) { - top = el.lpos.yi; - } - }); - self.draw = draw; - if (top !== -1) { - top = self.program.rows - top; - self.program.output.write(Array(top + 1).join('\n')); - } - self.render(); - }); - } - this.program.clear(); }; diff --git a/test/widget-noalt.js b/test/widget-noalt.js index 14bb264..65c147b 100644 --- a/test/widget-noalt.js +++ b/test/widget-noalt.js @@ -16,7 +16,8 @@ var list = blessed.list({ width: '50%', height: 'shrink', //border: 'line', - bottom: 2, + top: 5, + //bottom: 2, left: 0, style: { fg: 'blue',