Skip to content

Commit

Permalink
Fixes #100224: Use the actual contentWidth to determine if a horizont…
Browse files Browse the repository at this point in the history
…al scrollbar is necessary
  • Loading branch information
alexdima committed Jun 22, 2020
1 parent aa46585 commit 885b9f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vs/editor/common/viewLayout/viewLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ export class ViewLayout extends Disposable implements IViewLayout {
const width = layoutInfo.contentWidth;
const height = layoutInfo.height;
const scrollDimensions = this._scrollable.getScrollDimensions();
const scrollWidth = scrollDimensions.scrollWidth;
const contentWidth = scrollDimensions.contentWidth;
this._scrollable.setScrollDimensions(new EditorScrollDimensions(
width,
scrollDimensions.contentWidth,
height,
this._getContentHeight(width, height, scrollWidth)
this._getContentHeight(width, height, contentWidth)
));
} else {
this._updateHeight();
Expand Down Expand Up @@ -250,14 +250,14 @@ export class ViewLayout extends Disposable implements IViewLayout {
return scrollbar.horizontalScrollbarSize;
}

private _getContentHeight(width: number, height: number, scrollWidth: number): number {
private _getContentHeight(width: number, height: number, contentWidth: number): number {
const options = this._configuration.options;

let result = this._linesLayout.getLinesTotalHeight();
if (options.get(EditorOption.scrollBeyondLastLine)) {
result += height - options.get(EditorOption.lineHeight);
} else {
result += this._getHorizontalScrollbarHeight(width, scrollWidth);
result += this._getHorizontalScrollbarHeight(width, contentWidth);
}

return result;
Expand All @@ -267,12 +267,12 @@ export class ViewLayout extends Disposable implements IViewLayout {
const scrollDimensions = this._scrollable.getScrollDimensions();
const width = scrollDimensions.width;
const height = scrollDimensions.height;
const scrollWidth = scrollDimensions.scrollWidth;
const contentWidth = scrollDimensions.contentWidth;
this._scrollable.setScrollDimensions(new EditorScrollDimensions(
width,
scrollDimensions.contentWidth,
height,
this._getContentHeight(width, height, scrollWidth)
this._getContentHeight(width, height, contentWidth)
));
}

Expand Down

0 comments on commit 885b9f1

Please sign in to comment.