Make word jumps more consistent

This commit is contained in:
Laura Hausmann 2023-01-27 20:06:14 +01:00
parent f25c054b48
commit dd4d4fbd95
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -283,6 +283,8 @@ public static class tgcli {
var part1 = currentInputLine[..currentInputPos];
var lastIndex = part1.TrimEnd().LastIndexOf(" ", StringComparison.Ordinal);
if (lastIndex > 0)
lastIndex++;
if (lastIndex < 0)
lastIndex = 0;
currentInputPos = lastIndex;
@ -294,7 +296,7 @@ public static class tgcli {
break;
var index = currentInputLine.IndexOf(" ", currentInputPos + 1, StringComparison.Ordinal);
currentInputPos = index + 1;
currentInputPos = index;
if (index < 0)
currentInputPos = currentInputLine.Length;
ScreenUpdate();