File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -471,9 +471,12 @@ public void DrawMenu(Menu previousMenu, bool menuSelect)
471
471
// Move cursor to the start of the first line after our input.
472
472
var bufferEndPoint = Singleton . ConvertOffsetToPoint ( Singleton . _buffer . Length ) ;
473
473
console . SetCursorPosition ( bufferEndPoint . X , bufferEndPoint . Y ) ;
474
+ // Top must be initialized before calling AdjustForPossibleScroll, otherwise
475
+ // on the last line of the buffer, the scroll operation causes Top to point
476
+ // past the buffer, which in turn causes the menu to be printed twice.
477
+ this . Top = bufferEndPoint . Y + 1 ;
474
478
AdjustForPossibleScroll ( 1 ) ;
475
479
MoveCursorDown ( 1 ) ;
476
- this . Top = bufferEndPoint . Y + 1 ;
477
480
478
481
var bufferWidth = console . BufferWidth ;
479
482
var columnWidth = this . ColumnWidth ;
You can’t perform that action at this time.
0 commit comments