mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
* Fixes #4449. Regression in IsLegacyConsole mode where dirty cells are not handled correctly * Cursor position is always set in the beginning a new row or on non-dirty flags
This commit is contained in:
@@ -67,22 +67,6 @@ public abstract class OutputBase
|
||||
Attribute? redrawAttr = null;
|
||||
int lastCol = -1;
|
||||
|
||||
if (IsLegacyConsole)
|
||||
{
|
||||
// BUGBUG: This is a workaround for some regression in legacy console mode where
|
||||
// BUGBUG: dirty cells are not handled correctly. Mark all cells dirty as a workaround.
|
||||
lock (buffer.Contents!)
|
||||
{
|
||||
for (var row = 0; row < buffer.Rows; row++)
|
||||
{
|
||||
for (var c = 0; c < buffer.Cols; c++)
|
||||
{
|
||||
buffer.Contents [row, c].IsDirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SetCursorVisibility (CursorVisibility.Invisible);
|
||||
|
||||
for (int row = top; row < rows; row++)
|
||||
@@ -117,6 +101,8 @@ public abstract class OutputBase
|
||||
lastCol++;
|
||||
}
|
||||
|
||||
SetCursorPositionImpl (lastCol, row);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -296,8 +282,6 @@ public abstract class OutputBase
|
||||
|
||||
private void WriteToConsole (StringBuilder output, ref int lastCol, int row, ref int outputWidth)
|
||||
{
|
||||
SetCursorPositionImpl (lastCol, row);
|
||||
|
||||
if (IsLegacyConsole)
|
||||
{
|
||||
Write (output);
|
||||
|
||||
@@ -151,7 +151,7 @@ public class OutputBaseTests
|
||||
Assert.False (buffer.Contents! [0, 2].IsDirty);
|
||||
|
||||
// Verify SetCursorPositionImpl was invoked by WriteToConsole (cursor set to a written column)
|
||||
Assert.Equal (new Point (0, 0), output.GetCursorPosition ());
|
||||
Assert.Equal (new Point (2, 0), output.GetCursorPosition ());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
Reference in New Issue
Block a user