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

Re: zsh 5.3.1 crashes on completion



With the latest git master, expand-history doesn't work correctly:

[1]% echo one
[2]% echo two
[3]% !!<TAB>   (or the key bound to expand-history)

then !! expands to 'echo one' (!!<Return> works as expected).

It seems this is caused by the patch:

2017/05/16 20:05, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> --- a/Src/hist.c
> +++ b/Src/hist.c
(snip)
> @@ -261,6 +264,9 @@ hist_context_save(struct hist_stack *hs, int toplevel)
>      */
>     hs->cstack = cmdstack;
>     hs->csp = cmdsp;
> +    hs->curline_linked = curline_linked;
> +
> +    unlinkcurline();

which is included in the commit 94014ff65bc2bdd752717792b156cdfcbc5b5c98

doexpandhist() calles zcontext_save(), which calls hist_context_save(),
which now calls unlinkcurline(). So when the event !! is searched
curline has been unlinked and curhist has been decremented, and
!! expands to event 1 (not 2).




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