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

On 14 January 2016 at 10:52, Sebastian Gniazdowski
<[email-masked]> wrote:
> PS. I used the "find LBUFFER myself" approach to handle following case
> better ("|" is cursor):
>
> % $(( 0 |+ 1 ))
>
> Doing ${(z)LBUFFER} and then (z) on right part of BUFFER would produce
> SUFFIX="+" instead of "+ 1 ))".  If I find the word in ${(z)BUFFER}

That turned out to be not true, (z) isn't done on right part, instead
words[CURRENT] is utilized and chopped to obtain right part of shell
word.

    local -a left=( "${(z)LBUFFER}" )
    local right="${words[CURRENT]#${left[-1]}}"

So still clarifying things, maybe it's good idea to do (z) on right
part to obtain ${|a case behavior.

Best regards,
Sebastian Gniazdowski