@@ -36,6 +36,7 @@ struct RenderedLineData
36
36
class RenderData
37
37
{
38
38
public int bufferWidth ;
39
+ public int bufferHeight ;
39
40
public bool errorPrompt ;
40
41
public RenderedLineData [ ] lines ;
41
42
}
@@ -351,10 +352,12 @@ void UpdateColorsIfNecessary(string newColor)
351
352
// TODO: avoid writing everything.
352
353
353
354
var bufferWidth = _console . BufferWidth ;
355
+ var bufferHeight = _console . BufferHeight ;
354
356
355
357
// In case the buffer was resized
356
358
RecomputeInitialCoords ( ) ;
357
359
renderData . bufferWidth = bufferWidth ;
360
+ renderData . bufferHeight = bufferHeight ;
358
361
359
362
// Move the cursor to where we started, but make cursor invisible while we're rendering.
360
363
_console . CursorVisible = false ;
@@ -641,7 +644,8 @@ private void GetRegion(out int start, out int length)
641
644
642
645
private void RecomputeInitialCoords ( )
643
646
{
644
- if ( _previousRender . bufferWidth != _console . BufferWidth )
647
+ if ( ( _previousRender . bufferWidth != _console . BufferWidth )
648
+ || ( _previousRender . bufferHeight != _console . BufferHeight ) )
645
649
{
646
650
// If the buffer width changed, our initial coordinates
647
651
// may have as well.
@@ -673,6 +677,7 @@ private void MoveCursor(int newCursor)
673
677
// In case the buffer was resized
674
678
RecomputeInitialCoords ( ) ;
675
679
_previousRender . bufferWidth = _console . BufferWidth ;
680
+ _previousRender . bufferHeight = _console . BufferHeight ;
676
681
677
682
var point = ConvertOffsetToPoint ( newCursor ) ;
678
683
PlaceCursor ( point . X , point . Y ) ;
0 commit comments