Subject: Re: _history-complete-older problems with $(
From: Sebastian Gniazdowski <[email-masked]>
To: Bart Schaefer <[email-masked]>
Cc: Zsh hackers list <[email-masked]>
Date: Thu, 14 Jan 2016 19:55:31 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On 14 January 2016 at 05:48, Bart Schaefer <[email-masked]> wrote:
> Ah.  Another wrinkle I overlooked.  You need to store the original
> values of $PREFIX and $SUFFIX somewhere, e.g.
>
>     local origPREFIX=$PREFIX origSUFFIX=$SUFFIX
>
> Then, after "compadd -O found" but before trimming PREFIX and SUFFIX
> off of $found, you need
>
>     PREFIX=${PREFIX#$origPREFIX}
>     SUFFIX=${SUFFIX%$origSUFFIX}
>

Setting PREFIX and SUFFIX this way changes things (apparently for the
better, the code works very well with them, except for $(<TAB> as I
shown in other video, the "Better" one), but it's interesting that
PREFIX and SUFFIX do not change their values, I showed this in
following video:

https://asciinema.org/a/cf8yrmdzjqy7r2kz42091ujts

If I do PREFIX="$PREFIX" SUFFIX="$SUFFIX" then it doesn't change
things, interestingly, it's like no assignment would be done.

Best regards,
Sebastian