Skip to content
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 ConsoleInteractive/ConsoleInteractive/ConsoleWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public static void WriteLineFormatted(string value) {

internal static class InternalWriter {
private static void Write(string value) {
int linesAdded = 0;
foreach (string line in value.Split('\n'))
linesAdded += (line.Length / InternalContext.CursorLeftPosLimit) + 1;

lock (InternalContext.WriteLock) {

// If the buffer is initialized, then we should get the current cursor position
Expand All @@ -54,7 +58,6 @@ private static void Write(string value) {
ConsoleBuffer.ClearCurrentLine();

Console.WriteLine(value);
int linesAdded = (value.Length / InternalContext.CursorLeftPosLimit) + 1;

// Determine if we need to use the previous top position.
// i.e. vertically constrained.
Expand Down