Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [RFC PATCH 1/2] complete absolute paths for mpc add
- X-seq: zsh-workers 53233
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Karel Balej <balejk@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [RFC PATCH 1/2] complete absolute paths for mpc add
- Date: Sat, 9 Nov 2024 11:44:08 -0800
- Archived-at: <https://zsh.org/workers/53233>
- In-reply-to: <20240927163300.25833-1-balejk@matfyz.cz>
- List-id: <zsh-workers.zsh.org>
- References: <20240927163300.25833-1-balejk@matfyz.cz>
I didn't see this the first time around for some reason.
On Fri, Sep 27, 2024 at 9:34 AM Karel Balej <balejk@xxxxxxxxx> wrote:
>
> +(( $+functions[_mpc_helper_all_files] )) ||
> +_mpc_helper_all_files() {
> + if [[ $words[CURRENT] == [/~]* ]]; then
> + _files
> + fi
> + _mpc_helper_files
> +}
If _files succeeds ($? == 0) but _mpc_helper_files fails ($? != 0)
then _mpc_helper_all_files will appear to fail and completion will
proceed to the next possible alternative.
Does something like the following still give the result you expect?
_mpc_helper_all_files() {
local ret=1
if [[ $words[CURRENT] == [/~]* ]]; then
_files
ret=$?
fi
_mpc_helper_files || return ret
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author