update the viewportElement style width upon refreshing of the viewport to accomodate changes in scrollBarWidth
This commit is contained in:
@@ -348,6 +348,9 @@ function initOptions(term: TerminalType): void {
|
|||||||
} else if (o === 'lineHeight' || o === 'scrollSensitivity') {
|
} else if (o === 'lineHeight' || o === 'scrollSensitivity') {
|
||||||
term.setOption(o, parseFloat(input.value));
|
term.setOption(o, parseFloat(input.value));
|
||||||
updateTerminalSize();
|
updateTerminalSize();
|
||||||
|
} else if(o === 'scrollback') {
|
||||||
|
term.setOption(o, parseInt(input.value));
|
||||||
|
setTimeout(() => updateTerminalSize(), 5);
|
||||||
} else {
|
} else {
|
||||||
term.setOption(o, parseInt(input.value));
|
term.setOption(o, parseInt(input.value));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,12 @@ export class Viewport extends Disposable implements IViewport {
|
|||||||
this._ignoreNextScrollEvent = true;
|
this._ignoreNextScrollEvent = true;
|
||||||
this._viewportElement.scrollTop = scrollTop;
|
this._viewportElement.scrollTop = scrollTop;
|
||||||
}
|
}
|
||||||
|
if (this._optionsService.getOption('scrollback') === 0) {
|
||||||
|
this.scrollBarWidth = 0;
|
||||||
|
} else {
|
||||||
|
this.scrollBarWidth = (this._viewportElement.offsetWidth - this._scrollArea.offsetWidth) || FALLBACK_SCROLL_BAR_WIDTH;
|
||||||
|
}
|
||||||
|
this._viewportElement.style.width = (this._renderService.dimensions.actualCellWidth * (this._bufferService.cols) + this.scrollBarWidth).toString() + 'px';
|
||||||
this._refreshAnimationFrame = null;
|
this._refreshAnimationFrame = null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -131,6 +136,9 @@ export class Viewport extends Disposable implements IViewport {
|
|||||||
this._refresh(immediate);
|
this._refresh(immediate);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// This is for refreshing the viewport if scrollBarWidth has to be updated
|
||||||
|
this._refresh(immediate);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user