mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-02-22 15:48:07 +00:00
use _owrite instead of output.write.
This commit is contained in:
parent
2b26fe9952
commit
ee31799e7f
@ -243,7 +243,7 @@ Program.prototype.setupTput = function() {
|
|||||||
|
|
||||||
var self = this
|
var self = this
|
||||||
, options = this.options
|
, options = this.options
|
||||||
, write = this.write.bind(this);
|
, write = this._write.bind(this);
|
||||||
|
|
||||||
var tput = this.tput = new Tput({
|
var tput = this.tput = new Tput({
|
||||||
term: this.terminal,
|
term: this.terminal,
|
||||||
@ -1596,10 +1596,16 @@ Program.prototype.response = function(name, text, callback, noBypass) {
|
|||||||
: this._twrite(text);
|
: this._twrite(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Program.prototype._owrite =
|
||||||
|
Program.prototype.write = function(text) {
|
||||||
|
if (!this.output.writable) return;
|
||||||
|
return this.output.write(text);
|
||||||
|
};
|
||||||
|
|
||||||
Program.prototype._buffer = function(text) {
|
Program.prototype._buffer = function(text) {
|
||||||
if (this._exiting) {
|
if (this._exiting) {
|
||||||
this.flush();
|
this.flush();
|
||||||
this.output.write(text);
|
this._owrite(text);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1617,7 +1623,7 @@ Program.prototype._buffer = function(text) {
|
|||||||
|
|
||||||
Program.prototype.flush = function(text) {
|
Program.prototype.flush = function(text) {
|
||||||
if (!this._buf) return;
|
if (!this._buf) return;
|
||||||
this.output.write(this._buf);
|
this._owrite(this._buf);
|
||||||
this._buf = '';
|
this._buf = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1626,7 +1632,7 @@ Program.prototype._write = function(text) {
|
|||||||
if (this.useBuffer) {
|
if (this.useBuffer) {
|
||||||
return this._buffer(text);
|
return this._buffer(text);
|
||||||
}
|
}
|
||||||
return this.output.write(text);
|
return this._owrite(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Example: `DCS tmux; ESC Pt ST`
|
// Example: `DCS tmux; ESC Pt ST`
|
||||||
@ -1650,7 +1656,7 @@ Program.prototype._twrite = function(data) {
|
|||||||
if (self.output.bytesWritten > 0 || ++iterations === 50) {
|
if (self.output.bytesWritten > 0 || ++iterations === 50) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
self.flush();
|
self.flush();
|
||||||
self.output.write(data);
|
self._owrite(data);
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
return true;
|
return true;
|
||||||
@ -1661,14 +1667,14 @@ Program.prototype._twrite = function(data) {
|
|||||||
this.flush();
|
this.flush();
|
||||||
|
|
||||||
// Write out raw now that the buffer is flushed.
|
// Write out raw now that the buffer is flushed.
|
||||||
return this.output.write(data);
|
return this._owrite(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this._write(data);
|
return this._write(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
Program.prototype.echo =
|
Program.prototype.echo =
|
||||||
Program.prototype.write = function(text, attr) {
|
Program.prototype.print = function(text, attr) {
|
||||||
return attr
|
return attr
|
||||||
? this._write(this.text(text, attr))
|
? this._write(this.text(text, attr))
|
||||||
: this._write(text);
|
: this._write(text);
|
||||||
|
@ -1351,7 +1351,7 @@ Screen.prototype.draw = function(start, end) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this.program.flush();
|
// this.program.flush();
|
||||||
// this.program.output.write(pre + main + post);
|
// this.program._owrite(pre + main + post);
|
||||||
this.program._write(pre + main + post);
|
this.program._write(pre + main + post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ Terminal.prototype.bootstrap = function() {
|
|||||||
|
|
||||||
this.term.on('passthrough', function(data) {
|
this.term.on('passthrough', function(data) {
|
||||||
self.screen.program.flush();
|
self.screen.program.flush();
|
||||||
self.screen.program.output.write(data);
|
self.screen.program._owrite(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on('resize', function() {
|
this.on('resize', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user