Skip to content

Commit

Permalink
Merge pull request #766 from Tyriar/765_scroll_needlessly
Browse files Browse the repository at this point in the history
Don't refresh terminal when scrollDisp doesn't scroll
  • Loading branch information
Tyriar authored Jul 10, 2017
2 parents 99061c6 + c3011cd commit e849e3f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/xterm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1237,12 +1237,12 @@ Terminal.prototype.scrollDisp = function(disp, suppressScrollEvent) {
this.userScrolling = false;
}

this.ydisp += disp;
const oldYdisp = this.ydisp;
this.ydisp = Math.max(Math.min(this.ydisp + disp, this.ybase), 0);

if (this.ydisp > this.ybase) {
this.ydisp = this.ybase;
} else if (this.ydisp < 0) {
this.ydisp = 0;
// No change occurred, don't trigger scroll/refresh
if (oldYdisp === this.ydisp) {
return;
}

if (!suppressScrollEvent) {
Expand Down

0 comments on commit e849e3f

Please sign in to comment.