Have reverseIndex use CircularList.shiftElements 🎉
This commit is contained in:
+2
-11
@@ -3174,17 +3174,8 @@ Terminal.prototype.reverseIndex = function() {
|
|||||||
// possibly move the code below to term.reverseScroll();
|
// possibly move the code below to term.reverseScroll();
|
||||||
// test: echo -ne '\e[1;1H\e[44m\eM\e[0m'
|
// test: echo -ne '\e[1;1H\e[44m\eM\e[0m'
|
||||||
// blankLine(true) is xterm/linux behavior
|
// blankLine(true) is xterm/linux behavior
|
||||||
if (this.lines.length === this.lines.maxLength) {
|
this.lines.shiftElements(this.y + this.ybase, this.rows - 1, 1);
|
||||||
// Trim the start of lines to make room for the new temporary row
|
this.lines.set(this.y + this.ybase, this.blankLine(true));
|
||||||
// TODO: This section could be optimized by introducing a CircularList function that inserts,
|
|
||||||
// deletes and shifts elements to accomplish this task.
|
|
||||||
this.lines.trimStart(1);
|
|
||||||
this.ybase -= 1;
|
|
||||||
this.ydisp -= 1;
|
|
||||||
}
|
|
||||||
this.lines.splice(this.y + this.ybase, 0, this.blankLine(true));
|
|
||||||
j = this.rows - 1 - this.scrollBottom;
|
|
||||||
this.lines.splice(this.rows - 1 + this.ybase - j + 1, 1);
|
|
||||||
this.updateRange(this.scrollTop);
|
this.updateRange(this.scrollTop);
|
||||||
this.updateRange(this.scrollBottom);
|
this.updateRange(this.scrollBottom);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user