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

Re: [PATCH] add-zle-hook-widget



Bart Schaefer wrote on Sat, Jun 18, 2016 at 16:25:58 -0700:
> On Jun 16, 10:20pm, Bart Schaefer wrote:
> }
> } What you have convinced me is that in the absence of an explicit index
> } there's some value in retaining the order in which the add-* calls
> } were made, which the code as last pushed doesn't.
> 
> The following implements this, as well as fixing some bugs, most notably
> that "setopt ksharrays" broke a bunch of stuff.
> 
> There may still be other problems, and of course the discussion with Daniel
> hasn't really finished yet.

Yes, I'm replying as often as I can, but these days that's not as often
as I'd like ☹

>  for hook in $hooktypes
>  do
> +  # Check for an existing widget, add it as the first hook
> +  if [[ ${widgets[$hook]} = user:* ]]; then
> +      zle -A "$hook" "${widgets[$hook]}"
> +      zstyle -- "$hook" widgets 0:"${widgets[$hook]}"

The last parameter expansion should strip the "user:" prefix.

> +      zle -N "$hook" azhw:"$hook"
> +  fi

Cheers,

Daniel



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