Skip to content

Commit

Permalink
Cover a case when resizing smaller making y go out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Feb 8, 2019
1 parent b88230d commit d17dfbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class Buffer implements IBuffer {
let viewportAdjustments = linesToAdd - trimmedLines;
while (viewportAdjustments-- > 0) {
if (this.ybase === 0) {
if (this.y < this._rows - 1) {
if (this.y < newRows - 1) {
this.y++;
this.lines.pop();
} else {
Expand Down

0 comments on commit d17dfbc

Please sign in to comment.