Improve inputline speed
This commit is contained in:
parent
bd4fd3ec36
commit
2133c73491
|
@ -180,11 +180,6 @@ namespace tgcli {
|
|||
|
||||
public static void ScreenUpdate() {
|
||||
lock (@lock) {
|
||||
ClearCurrentConsoleLine();
|
||||
messageQueue.ForEach(p => Console.WriteLine(p + Ansi.ResetAll));
|
||||
if (messageQueue.Count > 0 && !silent)
|
||||
Console.Write("\a"); //ring terminal bell
|
||||
messageQueue.Clear();
|
||||
var status = GetFormattedStatus(currentUserRead);
|
||||
var output = prefix;
|
||||
if (connectionState != "Ready")
|
||||
|
@ -196,6 +191,12 @@ namespace tgcli {
|
|||
output += " > ";
|
||||
var prefixlen = GetActualStringWidth(output);
|
||||
output += TruncateMessageStart(currentInputLine, Console.LargestWindowWidth - GetActualStringWidth(output));
|
||||
|
||||
ClearCurrentConsoleLine();
|
||||
messageQueue.ForEach(p => Console.WriteLine(p + Ansi.ResetAll));
|
||||
if (messageQueue.Count > 0 && !silent)
|
||||
Console.Write("\a"); //ring terminal bell
|
||||
messageQueue.Clear();
|
||||
Console.Write(output);
|
||||
Console.Write($"\u001b[{Math.Min(currentInputPos + prefixlen + 1, Console.LargestWindowWidth)}G");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue