Skip to content

Commit 6e34da5

Browse files
committed
keeping the size the same for the hover widget
1 parent 3bbd621 commit 6e34da5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/vs/base/browser/ui/hover/hover.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
overflow: hidden;
1010
user-select: text;
1111
-webkit-user-select: text;
12-
box-sizing: initial;
12+
box-sizing: border-box;;
1313
animation: fadein 100ms linear;
1414
line-height: 1.5em;
1515
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ class ContentHoverVisibleData {
444444

445445
const HORIZONTAL_SCROLLING_BY = 30;
446446
const SCROLLBAR_WIDTH = 10;
447+
const CONTAINER_HEIGHT_PADDING = 6;
447448

448449
export class ContentHoverWidget extends ResizableContentWidget {
449450

@@ -573,6 +574,7 @@ export class ContentHoverWidget extends ResizableContentWidget {
573574
override _resize(size: dom.Dimension) {
574575
this._setAdjustedHoverWidgetDimensions(size);
575576
this._setResizableNodeMaxDimensions();
577+
this._resizableNode.layout(size.height, size.width);
576578
this._hover.scrollbar.scanDomNode();
577579
this._editor.layoutContentWidget(this);
578580
}
@@ -590,7 +592,7 @@ export class ContentHoverWidget extends ResizableContentWidget {
590592
if (!availableSpace) {
591593
return;
592594
}
593-
let maximumHeight = 0;
595+
let maximumHeight = CONTAINER_HEIGHT_PADDING;
594596
Array.from(this._hover.contentsDomNode.children).forEach((hoverPart) => {
595597
maximumHeight += hoverPart.clientHeight;
596598
});

0 commit comments

Comments
 (0)