From 2c337bb572bbb6ac3ceeb680bb8bb437add4a97d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 11 Jan 2014 19:32:43 -0600 Subject: [PATCH] minor listbar work. --- lib/widget.js | 2 +- test/widget-listbar.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/widget.js b/lib/widget.js index 8195201..cde3e7a 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -5961,7 +5961,7 @@ Listbar.prototype.render = function() { redo = true; return; } - el.width -= ((drawn + el.width) + el.width -= ((drawn + el.width + 0) // could be 2 without the autopadding check - (lpos.xl - lpos.xi - self.iwidth) // XXX WHY? This seems backwards: + (self.screen.autoPadding ? 1 : 0)); diff --git a/test/widget-listbar.js b/test/widget-listbar.js index 1d341d9..ab34dea 100644 --- a/test/widget-listbar.js +++ b/test/widget-listbar.js @@ -1,9 +1,11 @@ var blessed = require('../') , screen; +var auto = true; + screen = blessed.screen({ dump: __dirname + '/logs/listbar.log', - autoPadding: true + autoPadding: auto }); var box = blessed.box({ @@ -20,7 +22,7 @@ var bar = blessed.listbar({ bottom: 0, left: 3, right: 3, - height: 3, + height: auto ? 'shrink' : 3, mouse: true, keys: true, autoCommandKeys: true,