Commit 27425c15c4 ("autocompletion: fix slice out of bounds access")
introduced a regression in the autocompletion that messes up the order
of last entered chars when autocompletion runs.
The ranges for a slice a[low:high] are 0 <= low <= high <= len(a) [0]
To reproduce with the ":cf" command:
1) enter ":c"
2) wait for autocompleteion
3) enter "f"
4) the prompt will now be ":fc"
[0]: https://go.dev/ref/spec#Slice_expressions
Fixes: 27425c15c4 ("autocompletion: fix slice out of bounds access")
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>