Skip to content

Commit 885b9f1

Browse files
committed
Fixes microsoft#100224: Use the actual contentWidth to determine if a horizontal scrollbar is necessary
1 parent aa46585 commit 885b9f1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/vs/editor/common/viewLayout/viewLayout.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,12 @@ export class ViewLayout extends Disposable implements IViewLayout {
210210
const width = layoutInfo.contentWidth;
211211
const height = layoutInfo.height;
212212
const scrollDimensions = this._scrollable.getScrollDimensions();
213-
const scrollWidth = scrollDimensions.scrollWidth;
213+
const contentWidth = scrollDimensions.contentWidth;
214214
this._scrollable.setScrollDimensions(new EditorScrollDimensions(
215215
width,
216216
scrollDimensions.contentWidth,
217217
height,
218-
this._getContentHeight(width, height, scrollWidth)
218+
this._getContentHeight(width, height, contentWidth)
219219
));
220220
} else {
221221
this._updateHeight();
@@ -250,14 +250,14 @@ export class ViewLayout extends Disposable implements IViewLayout {
250250
return scrollbar.horizontalScrollbarSize;
251251
}
252252

253-
private _getContentHeight(width: number, height: number, scrollWidth: number): number {
253+
private _getContentHeight(width: number, height: number, contentWidth: number): number {
254254
const options = this._configuration.options;
255255

256256
let result = this._linesLayout.getLinesTotalHeight();
257257
if (options.get(EditorOption.scrollBeyondLastLine)) {
258258
result += height - options.get(EditorOption.lineHeight);
259259
} else {
260-
result += this._getHorizontalScrollbarHeight(width, scrollWidth);
260+
result += this._getHorizontalScrollbarHeight(width, contentWidth);
261261
}
262262

263263
return result;
@@ -267,12 +267,12 @@ export class ViewLayout extends Disposable implements IViewLayout {
267267
const scrollDimensions = this._scrollable.getScrollDimensions();
268268
const width = scrollDimensions.width;
269269
const height = scrollDimensions.height;
270-
const scrollWidth = scrollDimensions.scrollWidth;
270+
const contentWidth = scrollDimensions.contentWidth;
271271
this._scrollable.setScrollDimensions(new EditorScrollDimensions(
272272
width,
273273
scrollDimensions.contentWidth,
274274
height,
275-
this._getContentHeight(width, height, scrollWidth)
275+
this._getContentHeight(width, height, contentWidth)
276276
));
277277
}
278278

0 commit comments

Comments
 (0)