panic: runtime error: slice bounds out of range #852
The underlying crash has been fixed, but note that there are some problems with your example code:
So the correct code should be:
Also, you could just use
Finally, in a completer you don't do filtering; the filtering is handled in a separate pass; see https://elv.sh/ref/edit.html#argument-completer. Maybe I should rename "completer" to "generator" to make this clearer.