Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: minor niggle with svn completion of sub-commands
- X-seq: zsh-workers 27411
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: minor niggle with svn completion of sub-commands
- Date: Sun, 15 Nov 2009 16:17:50 -0800
- In-reply-to: <m3639cw7oc.fsf@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <19192.17676.966894.118536@xxxxxxxxxxxxxxxxxx> <m3fx8nmkwc.fsf@xxxxxxxxxxxxxx> <m3ws1v634w.fsf@xxxxxxxxxxxxxx> <20091112192553.2d76ce1d@pws-pc> <m3eio0x479.fsf@xxxxxxxxxxxxxx> <m3639cw7oc.fsf@xxxxxxxxxxxxxx>
On Nov 15, 2:47am, Greg Klanderman wrote:
}
} Here's a simple test showing that the '*::...' type argument
} descriptions are not handled correctly by _arguments:
It all goes awry at computil.c line 2133:
if ((adef = state.def = ca_get_arg(d, state.nth)) &&
(state.def->type == CAA_RREST ||
state.def->type == CAA_RARGS)) {
for the '*::' case, state.def->type == CAA_RREST so we enter the block
at 2136 and exit the entire loop at the "break" on 2151. Line 2133 is
the only place that RREST and RARGS are treated differently than REST
(line 2173 doesn't count as that's for the case of an argument of an
option ("optspec"), not a "normal argument").
The problem seems to be that we blindly clobber ca_laststate upon
discovering that we've reached the "rest" description. The patch
below changes this behavior but I'm not certain it's complete; it
may need an "else" clause, or maybe we should be breaking out of
the entire loop elsewhere as soon as ca_laststate.def is non-NULL.
This patch may claim it applies with an offset, it's a diff against
my own repository rather than the official one.
Index: computil.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/Zle/computil.c,v
retrieving revision 1.32
diff -c -r1.32 computil.c
--- computil.c 23 Nov 2008 18:26:28 -0000 1.32
+++ computil.c 16 Nov 2009 00:10:26 -0000
@@ -2130,10 +2144,12 @@
for (; line; line = compwords[cur++])
zaddlinknode(state.args, ztrdup(line));
- memcpy(&ca_laststate, &state, sizeof(state));
- ca_laststate.ddef = NULL;
- ca_laststate.dopt = NULL;
- ca_laststate.doff = 0;
+ if (!ca_laststate.def) {
+ memcpy(&ca_laststate, &state, sizeof(state));
+ ca_laststate.ddef = NULL;
+ ca_laststate.dopt = NULL;
+ ca_laststate.doff = 0;
+ }
break;
}
zaddlinknode(state.args, ztrdup(line));
Messages sorted by:
Reverse Date,
Date,
Thread,
Author