Fix exception when resizing both dimensions

This happened because buffers now resize themselves but they were
relying on Terminal to give them a blank line. The blank line was
coming back with the old columns value, causing an NPE.

Fixes #860
This commit is contained in:
Daniel Imms
2017-08-08 12:59:02 -07:00
parent a28d9f1456
commit bb526aaa88
5 changed files with 22 additions and 7 deletions
+11
View File
@@ -143,5 +143,16 @@ describe('Buffer', () => {
});
});
});
describe('row and column increased', () => {
it('should resize properly', () => {
buffer.fillViewportRows();
buffer.resize(INIT_COLS + 5, INIT_ROWS + 5);
assert.equal(buffer.lines.length, INIT_ROWS + 5);
for (let i = 0; i < INIT_ROWS + 5; i++) {
assert.equal(buffer.lines.get(i).length, INIT_COLS + 5);
}
});
});
});
});