diff --git a/lib/widget.js b/lib/widget.js index f33b7b1..5d03b7c 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -3906,11 +3906,11 @@ Element.prototype.render = function() { y = yi; if (coords.notop) y = -1; for (x = xi; x < xl; x++) { - if (!lines[y]) break; + if (!lines[y]) continue; if (coords.noleft && x === xi) continue; if (coords.noright && x === xl - 1) continue; cell = lines[y][x]; - if (!cell) break; + if (!cell) continue; if (this.border.type === 'line') { if (x === xi) { ch = '\u250c'; // '┌' @@ -3980,9 +3980,9 @@ Element.prototype.render = function() { } y = yi + 1; for (; y < yl - 1; y++) { - if (!lines[y]) break; + if (!lines[y]) continue; cell = lines[y][xi]; - if (!cell) break; + if (!cell) continue; if (this.border.type === 'line') { ch = '\u2502'; // '│' if (this.screen.dockBorders || this.dockBorders) { @@ -4002,7 +4002,7 @@ Element.prototype.render = function() { lines[y].dirty = true; } cell = lines[y][xl - 1]; - if (!cell) break; + if (!cell) continue; if (this.border.type === 'line') { ch = '\u2502'; // '│' if (this.screen.dockBorders || this.dockBorders) { @@ -4038,11 +4038,11 @@ Element.prototype.render = function() { y = yl - 1; if (coords.nobot) y = -1; for (x = xi; x < xl; x++) { - if (!lines[y]) break; + if (!lines[y]) continue; if (coords.noleft && x === xi) continue; if (coords.noright && x === xl - 1) continue; cell = lines[y][x]; - if (!cell) break; + if (!cell) continue; if (this.border.type === 'line') { if (x === xi) { ch = '\u2514'; // '└' diff --git a/test/widget-dock-noborder.js b/test/widget-dock-noborder.js new file mode 100644 index 0000000..337fe08 --- /dev/null +++ b/test/widget-dock-noborder.js @@ -0,0 +1,87 @@ +var blessed = require('../') + , screen; + +screen = blessed.screen({ + dump: __dirname + '/logs/dock.log', + smartCSR: true, + dockBorders: true +}); + +blessed.box({ + parent: screen, + left: -1, + top: -1, + width: '50%+1', + height: '50%+1', + border: 'line', + content: 'Foo' +}); + +blessed.box({ + parent: screen, + left: '50%-1', + top: -1, + width: '50%+3', + height: '50%+1', + content: 'Bar', + border: 'line' +}); + +blessed.box({ + parent: screen, + left: -1, + top: '50%-1', + width: '50%+1', + height: '50%+3', + border: 'line', + content: 'Foo' +}); + +blessed.listtable({ + parent: screen, + left: '50%-1', + top: '50%-1', + width: '50%+3', + height: '50%+3', + border: 'line', + align: 'center', + tags: true, + keys: true, + vi: true, + mouse: true, + style: { + header: { + fg: 'blue', + bold: true + }, + cell: { + fg: 'magenta', + selected: { + bg: 'blue' + } + } + }, + data: [ + [ 'Animals', 'Foods', 'Times', 'Numbers' ], + [ 'Elephant', 'Apple', '1:00am', 'One' ], + [ 'Bird', 'Orange', '2:15pm', 'Two' ], + [ 'T-Rex', 'Taco', '8:45am', 'Three' ], + [ 'Mouse', 'Cheese', '9:05am', 'Four' ] + ] +}).focus(); + +// blessed.box({ +// parent: screen, +// left: '50%-1', +// top: '50%-1', +// width: '50%+1', +// height: '50%+1', +// border: 'line', +// content: 'Bar' +// }); + +screen.key('q', function() { + return process.exit(0); +}); + +screen.render();