From ce20598ca90b922592e1ddf38eb8f218cc9daa73 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sun, 10 Dec 2017 11:13:22 -0400 Subject: Clean up old state code in ANSI interpreter --- util/Flushable.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'util/Flushable.js') diff --git a/util/Flushable.js b/util/Flushable.js index 78bf5c5..c852421 100644 --- a/util/Flushable.js +++ b/util/Flushable.js @@ -86,13 +86,13 @@ module.exports = class Flushable { compress(toWrite) { // TODO: customize screen size - let { newChars, lastChar, screen } = ansi.interpret( - toWrite, this.screenLines, this.screenCols, - this.lastFrameChars, this.lastFrameLastChar + const output = ansi.interpret( + toWrite, this.screenLines, this.screenCols, this.lastFrame ) - this.lastFrameChars = newChars - this.lastFrameLastChar = lastChar + let { screen } = output + + this.lastFrame = output if (this.shouldShowCompressionStatistics) { const pcSaved = Math.round(100 - (100 / toWrite.length * screen.length)) @@ -100,7 +100,7 @@ module.exports = class Flushable { '\x1b[H\x1b[0m(ANSI-interpret: ' + `${toWrite.length} -> ${screen.length} ${pcSaved}% saved) ` ) - this.lastFrameLastChar.attributes = [] + this.lastFrame.oldLastChar.attributes = [] } return screen -- cgit 1.3.0-6-gf8a5