trimAndRecycle with external check

This commit is contained in:
Jörg Breitbart
2018-10-22 18:15:47 +02:00
parent 6f6c7c20c0
commit 82228ad891
2 changed files with 20 additions and 6 deletions
+6 -1
View File
@@ -1202,7 +1202,12 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
// Insert the line using the fastest method
if (bottomRow === this.buffer.lines.length - 1) {
if (useRecycling) {
this.buffer.lines.pushRecycling((item) => (item) ? item.copyFrom(newLine) : newLine.clone());
// this.buffer.lines.pushRecycling((item) => (item) ? item.copyFrom(newLine) : newLine.clone());
if (willBufferBeTrimmed) {
(this.buffer.lines as any).trimAndRecycle().copyFrom(newLine);
} else {
this.buffer.lines.push(newLine.clone());
}
} else {
this.buffer.lines.push(newLine);
}