Skip to content

Fix duplicate menu at end of buffer #937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion PSReadLine/Completion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,12 @@ public void DrawMenu(Menu previousMenu, bool menuSelect)
// Move cursor to the start of the first line after our input.
var bufferEndPoint = Singleton.ConvertOffsetToPoint(Singleton._buffer.Length);
console.SetCursorPosition(bufferEndPoint.X, bufferEndPoint.Y);
// Top must be initialized before calling AdjustForPossibleScroll, otherwise
// on the last line of the buffer, the scroll operation causes Top to point
// past the buffer, which in turn causes the menu to be printed twice.
this.Top = bufferEndPoint.Y + 1;
AdjustForPossibleScroll(1);
MoveCursorDown(1);
this.Top = bufferEndPoint.Y + 1;

var bufferWidth = console.BufferWidth;
var columnWidth = this.ColumnWidth;
Expand Down