From fc0b553a4a36270fa9710e1fdd6c64eb324fde95 Mon Sep 17 00:00:00 2001
From: Phil Scott <phil.scott@gmail.com>
Date: Mon, 1 Apr 2024 11:36:38 -0400
Subject: [PATCH] Revert "Fixed render issue where writeline inside status
 caused corrupt output #415 #694"

This reverts commit 71a5d830671220e601e4e6ab4d4c352ae0e0a64a.

The commit introduced major flickering when working with LiveRenderables

Fixes #1466
---
 src/Spectre.Console/Live/LiveRenderable.cs    |  2 +-
 .../Live/Status/Render.Output.verified.txt    |  4 +--
 .../WriteLineOverflow.Output.verified.txt     | 12 ---------
 .../Unit/Live/StatusTests.cs                  | 26 -------------------
 4 files changed, 3 insertions(+), 41 deletions(-)
 delete mode 100644 test/Spectre.Console.Tests/Expectations/Live/Status/WriteLineOverflow.Output.verified.txt

diff --git a/src/Spectre.Console/Live/LiveRenderable.cs b/src/Spectre.Console/Live/LiveRenderable.cs
index a681d24..40107f9 100644
--- a/src/Spectre.Console/Live/LiveRenderable.cs
+++ b/src/Spectre.Console/Live/LiveRenderable.cs
@@ -49,7 +49,7 @@ internal sealed class LiveRenderable : Renderable
             }
 
             var linesToMoveUp = _shape.Value.Height - 1;
-            return new ControlCode("\r" + (EL(2) + CUU(1)).Repeat(linesToMoveUp));
+            return new ControlCode("\r" + CUU(linesToMoveUp));
         }
     }
 
diff --git a/test/Spectre.Console.Tests/Expectations/Live/Status/Render.Output.verified.txt b/test/Spectre.Console.Tests/Expectations/Live/Status/Render.Output.verified.txt
index cd5fed9..debe239 100644
--- a/test/Spectre.Console.Tests/Expectations/Live/Status/Render.Output.verified.txt
+++ b/test/Spectre.Console.Tests/Expectations/Live/Status/Render.Output.verified.txt
@@ -1,10 +1,10 @@
 [?25l     
 * foo
      
-     
+     
 - bar
      
-     
+     
 * baz
      
 [?25h
\ No newline at end of file
diff --git a/test/Spectre.Console.Tests/Expectations/Live/Status/WriteLineOverflow.Output.verified.txt b/test/Spectre.Console.Tests/Expectations/Live/Status/WriteLineOverflow.Output.verified.txt
deleted file mode 100644
index d3647bb..0000000
--- a/test/Spectre.Console.Tests/Expectations/Live/Status/WriteLineOverflow.Output.verified.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-[?25l                                                    
-⣷ long text that should not interfere writeline text
-                                                    
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-xxxxxxxxxx
-                                                    
-⣷ long text that should not interfere writeline text
-                                                    
-                                                    
-⣷ long text that should not interfere writeline text
-                                                    
-[?25h
\ No newline at end of file
diff --git a/test/Spectre.Console.Tests/Unit/Live/StatusTests.cs b/test/Spectre.Console.Tests/Unit/Live/StatusTests.cs
index b80c5d0..a9510ad 100644
--- a/test/Spectre.Console.Tests/Unit/Live/StatusTests.cs
+++ b/test/Spectre.Console.Tests/Unit/Live/StatusTests.cs
@@ -48,30 +48,4 @@ public sealed class StatusTests
         // Then
         return Verifier.Verify(console.Output);
     }
-
-    [Fact]
-    [Expectation("WriteLineOverflow")]
-    public Task Should_Render_Correctly_When_WriteLine_Exceeds_Console_Width()
-    {
-        // Given
-        var console = new TestConsole()
-            .Colors(ColorSystem.TrueColor)
-            .Width(100)
-            .Interactive()
-            .EmitAnsiSequences();
-        var status = new Status(console)
-        {
-            AutoRefresh = false,
-        };
-
-        // When
-        status.Start("long text that should not interfere writeline text", ctx =>
-        {
-            ctx.Refresh();
-            console.WriteLine("x".Repeat(console.Profile.Width + 10), new Style(foreground: Color.White));
-        });
-
-        // Then
-        return Verifier.Verify(console.Output);
-    }
 }