mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00
This reverts commit 71a5d830671220e601e4e6ab4d4c352ae0e0a64a. The commit introduced major flickering when working with LiveRenderables Fixes #1466
This commit is contained in:
parent
1a3249cdae
commit
fc0b553a4a
@ -49,7 +49,7 @@ internal sealed class LiveRenderable : Renderable
|
|||||||
}
|
}
|
||||||
|
|
||||||
var linesToMoveUp = _shape.Value.Height - 1;
|
var linesToMoveUp = _shape.Value.Height - 1;
|
||||||
return new ControlCode("\r" + (EL(2) + CUU(1)).Repeat(linesToMoveUp));
|
return new ControlCode("\r" + CUU(linesToMoveUp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
[?25l
|
[?25l
|
||||||
[38;5;11m*[0m foo
|
[38;5;11m*[0m foo
|
||||||
|
|
||||||
[2K[1A[2K[1A
|
[2A
|
||||||
[38;5;11m-[0m bar
|
[38;5;11m-[0m bar
|
||||||
|
|
||||||
[2K[1A[2K[1A
|
[2A
|
||||||
[38;5;11m*[0m baz
|
[38;5;11m*[0m baz
|
||||||
|
|
||||||
[2K[1A[2K[1A[2K[?25h
|
[2K[1A[2K[1A[2K[?25h
|
@ -1,12 +0,0 @@
|
|||||||
[?25l
|
|
||||||
[38;5;11m⣷[0m long text that should not interfere writeline text
|
|
||||||
|
|
||||||
[2K[1A[2K[1A[38;5;15mxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[0m
|
|
||||||
[38;5;15mxxxxxxxxxx[0m
|
|
||||||
|
|
||||||
[38;5;11m⣷[0m long text that should not interfere writeline text
|
|
||||||
|
|
||||||
[2K[1A[2K[1A
|
|
||||||
[38;5;11m⣷[0m long text that should not interfere writeline text
|
|
||||||
|
|
||||||
[2K[1A[2K[1A[2K[?25h
|
|
@ -48,30 +48,4 @@ public sealed class StatusTests
|
|||||||
// Then
|
// Then
|
||||||
return Verifier.Verify(console.Output);
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user