Skip to content

Commit 599349d

Browse files
committed
Fix showing tooltips at bottom of buffer
1 parent dae3f14 commit 599349d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PSReadLine/Completion.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ public void UpdateMenuSelection(int selectedItem, bool select, bool showTooltips
579579
var toolTipLines = 2;
580580
if (showTooltips)
581581
{
582-
// Determine if showing the tooltip would scroll the screen, if so, also don't show it.
582+
// Determine if showing the tooltip would scroll the top of our buffer off the screen.
583583

584584
int lineLength = 0;
585585
for (var i = 0; i < toolTip.Length; i++)
@@ -607,8 +607,8 @@ public void UpdateMenuSelection(int selectedItem, bool select, bool showTooltips
607607
}
608608
}
609609

610-
// The +1 is for a new line after showing the tool tips
611-
if ((Top + Rows + toolTipLines + 1) > console.WindowHeight)
610+
// The +1 is for the blank line between the menu and tooltips.
611+
if (BufferLines + Rows + toolTipLines + 1 > console.WindowHeight)
612612
{
613613
showTooltips = false;
614614
}

0 commit comments

Comments
 (0)