mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-24 01:38:54 +00:00
fix error caused when screen.render() is called during a delayed resize.
This commit is contained in:
parent
41cb97d664
commit
c0e36f137d
@ -660,7 +660,11 @@ Screen.prototype.render = function() {
|
||||
});
|
||||
this._ci = -1;
|
||||
|
||||
this.draw(0, this.rows - 1);
|
||||
// Cannot use this.rows here because of the resize delay:
|
||||
// `rows` and `cols` get set instantly by the resize, but `alloc` has a 300ms
|
||||
// delay before the new cells are added, which will sometimes throw. Measure
|
||||
// by lines.
|
||||
this.draw(0, this.lines.length - 1);
|
||||
|
||||
// XXX Workaround to deal with cursor pos before the screen has rendered and
|
||||
// lpos is not reliable (stale).
|
||||
@ -908,7 +912,11 @@ Screen.prototype.draw = function(start, end) {
|
||||
out = '';
|
||||
attr = this.dattr;
|
||||
|
||||
for (x = 0; x < this.cols; x++) {
|
||||
// Cannot use this.cols here because of the resize delay:
|
||||
// `rows` and `cols` get set instantly by the resize, but `alloc` has a
|
||||
// 300ms delay before the new cells are added, which will sometimes throw.
|
||||
// Measure by line length.
|
||||
for (x = 0; x < line.length; x++) {
|
||||
data = line[x][0];
|
||||
ch = line[x][1];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user