Properly shrink rows to cols every time
This commit is contained in:
+7
-1
@@ -162,7 +162,7 @@ export class Buffer implements IBuffer {
|
|||||||
// The following adjustments should only happen if the buffer has been
|
// The following adjustments should only happen if the buffer has been
|
||||||
// initialized/filled.
|
// initialized/filled.
|
||||||
if (this.lines.length > 0) {
|
if (this.lines.length > 0) {
|
||||||
// Deal with columns increasing (we don't do anything when columns reduce)
|
// Deal with columns increasing (reducing needs to happen after reflow)
|
||||||
if (this._terminal.cols < newCols) {
|
if (this._terminal.cols < newCols) {
|
||||||
const ch: CharData = [DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]; // does xterm use the default attr?
|
const ch: CharData = [DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]; // does xterm use the default attr?
|
||||||
for (let i = 0; i < this.lines.length; i++) {
|
for (let i = 0; i < this.lines.length; i++) {
|
||||||
@@ -236,6 +236,12 @@ export class Buffer implements IBuffer {
|
|||||||
|
|
||||||
if (this._terminal.options.experimentalBufferLineImpl === 'TypedArray') {
|
if (this._terminal.options.experimentalBufferLineImpl === 'TypedArray') {
|
||||||
this._reflow(newCols);
|
this._reflow(newCols);
|
||||||
|
|
||||||
|
if (this._terminal.cols > newCols) {
|
||||||
|
for (let i = 0; i < this.lines.length; i++) {
|
||||||
|
this.lines.get(i).resize(newCols, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -521,7 +521,7 @@ export interface IBufferLine {
|
|||||||
insertCells(pos: number, n: number, ch: CharData): void;
|
insertCells(pos: number, n: number, ch: CharData): void;
|
||||||
deleteCells(pos: number, n: number, fill: CharData): void;
|
deleteCells(pos: number, n: number, fill: CharData): void;
|
||||||
replaceCells(start: number, end: number, fill: CharData): void;
|
replaceCells(start: number, end: number, fill: CharData): void;
|
||||||
resize(cols: number, fill: CharData, shrink?: boolean): void;
|
resize(cols: number, fill: CharData): void;
|
||||||
fill(fillCharData: CharData): void;
|
fill(fillCharData: CharData): void;
|
||||||
copyFrom(line: IBufferLine): void;
|
copyFrom(line: IBufferLine): void;
|
||||||
clone(): IBufferLine;
|
clone(): IBufferLine;
|
||||||
|
|||||||
Reference in New Issue
Block a user