From dd4d4fbd95e047e547b59afac9dc33e6a8937327 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 27 Jan 2023 20:06:14 +0100 Subject: [PATCH] Make word jumps more consistent --- tgcli/tgcli.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tgcli/tgcli.cs b/tgcli/tgcli.cs index 153f649..0ea8f06 100644 --- a/tgcli/tgcli.cs +++ b/tgcli/tgcli.cs @@ -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();