Skip to content

Commit a1874cd

Browse files
committed
removing code that appears to be redundant, resetting the width
1 parent 75befc2 commit a1874cd

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/vs/editor/contrib/hover/browser/contentHover.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ class ContentHoverData {
449449
const HORIZONTAL_SCROLLING_BY = 30;
450450
const SCROLLBAR_WIDTH = 10;
451451
const SASH_WIDTH_MINUS_BORDER = 3;
452-
const BORDER_WIDTH = 1;
453452

454453
export class ResizableHoverWidget extends MultiplePersistedSizeResizableContentWidget {
455454

@@ -775,19 +774,19 @@ export class ResizableHoverWidget extends MultiplePersistedSizeResizableContentW
775774
private _setPersistedHoverDimensionsOrRenderNormally(): void {
776775
const persistedSize = this.findPersistedSize();
777776
// Suppose a persisted size is defined
777+
let width: number | string;
778+
let height: number | string;
778779
if (persistedSize) {
779-
const width = Math.min(this._findAvailableSpaceHorizontally() ?? Infinity, persistedSize.width - 2 * SASH_WIDTH_MINUS_BORDER);
780-
const height = Math.min(this._findAvailableSpaceVertically() ?? Infinity, persistedSize.height - 2 * SASH_WIDTH_MINUS_BORDER);
781-
this._setHoverWidgetDimensions(width, height);
780+
width = Math.min(this._findAvailableSpaceHorizontally() ?? Infinity, persistedSize.width - 2 * SASH_WIDTH_MINUS_BORDER);
781+
height = Math.min(this._findAvailableSpaceVertically() ?? Infinity, persistedSize.height - 2 * SASH_WIDTH_MINUS_BORDER);
782782
} else {
783783
// Added because otherwise the initial size of the hover content is smaller than should be
784784
const layoutInfo = this._editor.getLayoutInfo();
785785
this._resizableNode.layout(layoutInfo.height, layoutInfo.width);
786-
this._setHoverWidgetDimensions('auto', 'auto');
787-
// Added otherwise rendered too small horizontally
788-
const containerDomNode = this._hoverWidget.containerDomNode;
789-
this._setContainerDomNodeDimensions(containerDomNode.clientWidth + 2 * BORDER_WIDTH, containerDomNode.clientHeight);
786+
width = 'auto';
787+
height = 'auto';
790788
}
789+
this._setHoverWidgetDimensions(width, height);
791790
}
792791

793792
private _setContainerAbsolutePosition(top: number, left: number): void {

0 commit comments

Comments
 (0)