disable newlines, fix alt+delete

This commit is contained in:
Laura Hausmann 2019-12-22 00:25:14 +01:00
parent 893534935f
commit 91fd81e643
Signed by: zotan
GPG key ID: 5EC1D38FFC321311
2 changed files with 6 additions and 7 deletions

View file

@ -416,12 +416,12 @@ namespace telegram {
public static void RemoveFromInputLineForward(bool word = false) {
var part1 = currentInputLine.Substring(0, currentInputPos);
var part2 = currentInputLine.Substring(currentInputPos);
var part2 = currentInputLine.Substring(currentInputPos).TrimStart();
if (word) {
var index = part2.IndexOf(" ", StringComparison.Ordinal);
if (index < 0)
index = part2.Length - 1;
part2 = part2.Substring(0, index);
part2 = part2.Substring(index + 1);
if (index != 0)
part2 = " " + part2;
//if (part2.StartsWith("⏎"))

View file

@ -240,7 +240,6 @@ namespace telegram {
break;
case ConsoleKey.Delete when currentInputLine.Length >= 1 && currentInputPos < currentInputLine.Length:
if (key.Modifiers.HasFlag(ConsoleModifiers.Alt)) {
RemoveFromInputLineForward(true);
ScreenUpdate();
return;
}
@ -285,10 +284,10 @@ namespace telegram {
case ConsoleKey.DownArrow: break;
default: {
switch (key.Key) {
case ConsoleKey.N when key.Modifiers.HasFlag(ConsoleModifiers.Control):
InsertToInputLine("⏎ ");
ScreenUpdate();
return;
//case ConsoleKey.N when key.Modifiers.HasFlag(ConsoleModifiers.Control):
// InsertToInputLine("⏎ ");
// ScreenUpdate();
// return;
case ConsoleKey.D when key.Modifiers.HasFlag(ConsoleModifiers.Control):
HandleCommand(currentChatId == 0 ? "q" : "c");
ScreenUpdate();