From d7f2ec89d783692760b9f666fe0d6229a83dac50 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 24 Dec 2016 03:17:30 -0800 Subject: [PATCH] Polish --- src/utils/CircularList.ts | 1 - src/xterm.js | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/CircularList.ts b/src/utils/CircularList.ts index a84a98eb..8835acb0 100644 --- a/src/utils/CircularList.ts +++ b/src/utils/CircularList.ts @@ -38,7 +38,6 @@ export class CircularList { } public set length(newLength: number) { - // TODO: Is this auto fill is needed or can it be if (newLength > this._length) { for (let i = this._length; i < newLength; i++) { this._array[i] = undefined; diff --git a/src/xterm.js b/src/xterm.js index 8ede46ed..a475b75f 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -3706,6 +3706,7 @@ Terminal.prototype.insertLines = function(params) { while (param--) { if (this.lines.length === this.lines.maxLength) { + // Trim the start of lines to make room for the new line this.lines.trimStart(1); this.ybase--; this.ydisp--; @@ -3740,9 +3741,7 @@ Terminal.prototype.deleteLines = function(params) { while (param--) { if (this.lines.length === this.lines.maxLength) { - // Trim the start of lines to make room for the new temporary row - // TODO: This section could be optimized by introducing a CircularList function that inserts, - // deletes and shifts elements to accomplish this task. + // Trim the start of lines to make room for the new line this.lines.trimStart(1); this.ybase -= 1; this.ydisp -= 1;