mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-27 19:25:37 +00:00
more scroll fixing.
This commit is contained in:
parent
3d52833fa3
commit
787c7c6945
@ -1674,9 +1674,6 @@ ScrollableText.prototype.scroll = function(offset) {
|
|||||||
// When scrolling text, we want to be able to handle SGR codes as well as line
|
// When scrolling text, we want to be able to handle SGR codes as well as line
|
||||||
// feeds. This allows us to take preformatted text output from other programs
|
// feeds. This allows us to take preformatted text output from other programs
|
||||||
// and put it in a scrollable text box.
|
// and put it in a scrollable text box.
|
||||||
// TODO: Move this into a separate function and call it from the constructor
|
|
||||||
// and setContent.
|
|
||||||
// TODO: Possibly map _clines into line lengths only to save memory.
|
|
||||||
if (this.content != null) {
|
if (this.content != null) {
|
||||||
w = this.width - (this.border ? 2 : 0);
|
w = this.width - (this.border ? 2 : 0);
|
||||||
if (this._clines == null || this._clines.width !== w) {
|
if (this._clines == null || this._clines.width !== w) {
|
||||||
@ -1714,8 +1711,11 @@ ScrollableText.prototype._recalculateIndex = function() {
|
|||||||
this._clines = wrapContent(this.content, this.width - (this.border ? 2 : 0));
|
this._clines = wrapContent(this.content, this.width - (this.border ? 2 : 0));
|
||||||
this._pcontent = this._clines.join('\n');
|
this._pcontent = this._clines.join('\n');
|
||||||
|
|
||||||
if (this.childBase > this._clines.length - 1) {
|
var max = this._clines.length - 1 - (this.height - (this.border ? 2 : 0));
|
||||||
this.childBase = this._clines.length - 1;
|
if (max < 0) max = 0;
|
||||||
|
|
||||||
|
if (this.childBase > max) {
|
||||||
|
this.childBase = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0, t = 0; i < this.childBase; i++) {
|
for (var i = 0, t = 0; i < this.childBase; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user