Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature Patch: Use completion to view parameter values
- X-seq: zsh-workers 48309
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Marlon Richert <marlon.richert@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Feature Patch: Use completion to view parameter values
- Date: Mon, 29 Mar 2021 07:39:13 +0000
- Archived-at: <https://zsh.org/workers/48309>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/20210329073913.GP18178%40tarpaulin.shahaf.local2>
- In-reply-to: <CAHLkEDtf6JqSn86duXjEuQFXGKJn8COcxnEypoOUV=V63SsdPQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDtf6JqSn86duXjEuQFXGKJn8COcxnEypoOUV=V63SsdPQ@mail.gmail.com>
Marlon Richert wrote on Sun, Mar 28, 2021 at 23:53:29 +0300:
> +++ b/Completion/Zsh/Type/_parameters
> @@ -32,8 +37,18 @@ zstyle -t ":completion:${curcontext}:parameters"
> +if zstyle -t ":completion:${curcontext}:parameters" extra-verbose; then
> + zstyle -s ":completion:${curcontext}:parameters" list-separator sep ||
> + sep=--
> + zformat -a disp " $sep " ${matches[@]:/(#m)*/"${MATCH}:${(Pkv@q+)MATCH}"}
What about parameters implemented by modules? The getters of those may
run arbitrary code, and may have side effects: e.g., imagine an
$AUTOINCREMENT parameter that returns an incremented-by-one value every
time it's evaluated:
% repeat 3 echo $AUTOINCREMENT
1
2
3
% echo $AUTOINCR<TAB><Enter>
Wouldn't that print «5»?
Cheers,
Daniel
> + disp=( "${disp[@]:/(#m)*/$MATCH[1,COLUMNS]}" )
> + dopt=( -d disp )
> +fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author