This commit is contained in:
Daniel Imms
2018-12-27 23:58:57 -08:00
parent fa47036982
commit 8bc04c2fa7
2 changed files with 4 additions and 11 deletions
+3 -11
View File
@@ -300,8 +300,8 @@ export class Buffer implements IBuffer {
const countToRemove = wrappedLines.length - destLineIndex - 1;
if (countToRemove > 0) {
this.lines.splice(y + wrappedLines.length - countToRemove, countToRemove);
let removing = countToRemove;
while (removing-- > 0) {
let viewportAdjustments = countToRemove;
while (viewportAdjustments-- > 0) {
if (this.ybase === 0) {
this.y--;
// Add an extra row at the bottom of the viewport
@@ -314,7 +314,6 @@ export class Buffer implements IBuffer {
}
}
}
// TODO: Handle list trimming
return wrappedLines.length - countToRemove - 1;
}
@@ -326,9 +325,6 @@ export class Buffer implements IBuffer {
return 0;
}
// TODO: How is the cursor x handled if it's wrapped? Do something special when the cursor is this line?
// Gather wrapped lines if it's wrapped
let lineIndex = y;
let nextLine = this.lines.get(++lineIndex) as BufferLine;
@@ -340,9 +336,6 @@ export class Buffer implements IBuffer {
// Determine how many lines need to be inserted at the end, based on the trimmed length of
// the last wrapped line
if (wrappedLines[wrappedLines.length - 1].getTrimmedLength() === undefined) {
debugger;
}
const lastLineLength = wrappedLines[wrappedLines.length - 1].getTrimmedLength();
const cellsNeeded = (wrappedLines.length - 1) * this._terminal.cols + lastLineLength;
const linesNeeded = Math.ceil(cellsNeeded / newCols);
@@ -351,8 +344,7 @@ export class Buffer implements IBuffer {
// Add the new lines
const newLines: BufferLine[] = [];
for (let i = 0; i < linesToAdd; i++) {
// TODO: Remove any!
const newLine = this.getBlankLine((this._terminal as any).eraseAttr(), true) as BufferLine;
const newLine = this.getBlankLine(this._terminal.eraseAttr(), true) as BufferLine;
newLines.push(newLine);
}
this.lines.splice(y + wrappedLines.length, 0, ...newLines);
+1
View File
@@ -230,6 +230,7 @@ export interface ITerminal extends PublicTerminal, IElementAccessor, IBufferAcce
cancel(ev: Event, force?: boolean): boolean | void;
log(text: string): void;
showCursor(): void;
eraseAttr(): number;
}
export interface IBufferAccessor {