Improve inputline speed
This commit is contained in:
parent
bd4fd3ec36
commit
2133c73491
|
@ -180,11 +180,6 @@ namespace tgcli {
|
||||||
|
|
||||||
public static void ScreenUpdate() {
|
public static void ScreenUpdate() {
|
||||||
lock (@lock) {
|
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 status = GetFormattedStatus(currentUserRead);
|
||||||
var output = prefix;
|
var output = prefix;
|
||||||
if (connectionState != "Ready")
|
if (connectionState != "Ready")
|
||||||
|
@ -196,6 +191,12 @@ namespace tgcli {
|
||||||
output += " > ";
|
output += " > ";
|
||||||
var prefixlen = GetActualStringWidth(output);
|
var prefixlen = GetActualStringWidth(output);
|
||||||
output += TruncateMessageStart(currentInputLine, Console.LargestWindowWidth - 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(output);
|
||||||
Console.Write($"\u001b[{Math.Min(currentInputPos + prefixlen + 1, Console.LargestWindowWidth)}G");
|
Console.Write($"\u001b[{Math.Min(currentInputPos + prefixlen + 1, Console.LargestWindowWidth)}G");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue