Skip to content

Commit c7286fe

Browse files
authored
Merge pull request #571 from zarlo/patch-1
Console Optimize
2 parents e75262f + 0cc2ef0 commit c7286fe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

source/Cosmos.System/Console.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public void NewLine() {
6363
mX = 0;
6464
if (mY == mText.Rows) {
6565
mText.ScrollUp();
66-
mY = mText.Rows - 1;
67-
mX = 0;
66+
mY--;
6867
}
6968
UpdateCursor();
7069
}
@@ -93,8 +92,14 @@ public void Write(string aText) {
9392
if (aText[i] == '\n') {
9493
NewLine();
9594
} else if (aText[i] == '\r') {
95+
mX = 0;
96+
UpdateCursor();
9697
} else if (aText[i] == '\t') {
97-
Write(" ");
98+
//Write(" ");
99+
WriteChar(' ');
100+
WriteChar(' ');
101+
WriteChar(' ');
102+
WriteChar(' ');
98103
} else {
99104
WriteChar(aText[i]);
100105
}

0 commit comments

Comments
 (0)