Implement proper word navigation escape sequences (closes #2)

This commit is contained in:
Laura Hausmann 2023-01-18 02:44:30 +01:00
parent 9dd2f06160
commit e00a4c793d
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -250,6 +250,7 @@ namespace tgcli {
// currentInputLine = currentInputLine.Remove(currentInputLine.Length - 1);
ScreenUpdate();
break;
case ConsoleKey.B when key.Modifiers.HasFlag(ConsoleModifiers.Alt):
case ConsoleKey.LeftArrow when key.Modifiers.HasFlag(ConsoleModifiers.Alt):
if (currentInputPos == 0)
break;
@ -261,6 +262,7 @@ namespace tgcli {
currentInputPos = lastIndex;
ScreenUpdate();
break;
case ConsoleKey.F when key.Modifiers.HasFlag(ConsoleModifiers.Alt):
case ConsoleKey.RightArrow when key.Modifiers.HasFlag(ConsoleModifiers.Alt):
if (currentInputPos >= currentInputLine.Length)
break;