Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: _history-complete-older problems with $(



On 14 January 2016 at 10:52, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author