Merge pull request #224 from sourcelair/Tyriar-patch-2

Sync scroll bar height if the viewport height changes
This commit is contained in:
Daniel Imms
2016-08-09 09:03:16 -07:00
committed by GitHub
+7
View File
@@ -375,14 +375,19 @@
*/
Viewport.prototype.syncScrollArea = function() {
if (this.isApplicationMode) {
// Fix scroll bar in application mode
this.lastRecordedBufferLength = this.terminal.rows;
this.refresh();
return;
}
if (this.lastRecordedBufferLength !== this.terminal.lines.length) {
// If buffer height changed
this.lastRecordedBufferLength = this.terminal.lines.length;
this.refresh();
} else if (this.lastRecordedViewportHeight !== this.terminal.rows) {
// If viewport height changed
this.refresh();
} else {
// If size has changed, refresh viewport
var size = this.charMeasureElement.getBoundingClientRect();
@@ -390,6 +395,8 @@
this.refresh(size);
}
}
// Sync scrollTop
var scrollTop = this.terminal.ydisp * this.currentRowHeight;
if (this.viewportElement.scrollTop !== scrollTop) {
this.viewportElement.scrollTop = scrollTop;