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

Re: PATCH: completion match ordering



Hi Oliver,

unfortunately this patch (Git commit cd6fd2b0a) breaks completion for
"git commit --fixup" for me, which then looks like this:

% git commit --fixup=
--fixup
 -- option --
















--fixup

-- stage all modified and deleted paths
-- allow recording an empty commit
...

I hope you can reproduce this, otherwise I'd have to investigate.


Best,
Daniel.

On 06.05.19 23:16, Oliver Kiddle wrote:

> I finally got around to finishing off the changes to the options for completion
> match ordering via compadd -o. Thanks to dana for reminding me about this.
>
> The argument to -o is now optional and can be abbreviated, e.g. -omat,rev
> The sort style also accepts values like "numeric" and documentation and
> tests have been added.
>
> _description, _all_labels etc all take -V, -1, -2 options and in the previous
> patch, I had added -o to that. However, as far as I can tell that only has any
> use in the case of -V because the functions need to decide whether to add -J
> group or -V group. So it was only needed because the interface conflates the
> use of -V - specifying the group name and making it unsorted. I guess -1 and -2
> were handled because it is common to combine them as -1V, -2J etc. Given that
> it'd be useless, I decided not to add it.
>
> Back when sort was added to _description in 18859, it was decided to have it
> explicitly ignore the style if -V was passed. While, I would tend towards the
> view that it is better to give users control anyway, it remains that way for
> now. You don't need to pass -V to _wanted as such. To allow the style to enable
> sorting, we would need to add a compadd -o value corresponding to normal sort
> order: perhaps `sort' or `lexical' (i.e. not numeric). We could then rely on
> compadd honouring only the first -o option passed to it.
>
> The combination nosort,reverse could perhaps preserve (but reverse) the
> original order.
>
> We could perhaps also add the backslash ignoring that dana recently restored as
> an option to -o. In my testing, that patch looks good by the way - thanks dana.
>
> Oliver
>
> diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description
> index 304c747a6..c2a0e080b 100644
> --- a/Completion/Base/Core/_description
> +++ b/Completion/Base/Core/_description
> @@ -1,13 +1,13 @@
>  #autoload
>
…



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