summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-08-03 20:57:32 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-08-03 20:57:32 +0000
commit4a3ce8ab89c73f88559d9c48fdb4ed459a8aceef (patch)
tree383ec6d78f7706104972d692226f8729d13f60ab
parentd48faef8cdff3c7c63c0a9164443e3d337aa1ec1 (diff)
downloadzsh-4a3ce8ab89c73f88559d9c48fdb4ed459a8aceef.tar.gz
zsh-4a3ce8ab89c73f88559d9c48fdb4ed459a8aceef.zip
29644: work around _describe bug, plus cosmetic tweaks
-rw-r--r--ChangeLog6
-rw-r--r--Functions/Chpwd/zsh_directory_name_cdr2
-rw-r--r--Src/Zle/compcore.c3
-rw-r--r--Src/Zle/zle_tricky.c13
4 files changed, 20 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c6209fca0..dfc2b987e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2011-08-03 Peter Stephenson <p.w.stephenson@ntlworld.com>
+ * 29644: Functions/Chpwd/zsh_directory_name_cdr,
+ Src/Zle/compcore.c, Src/Zle/zle_tricky.c: Work round a bug in
+ _describe, plus a new comment and some more braces.
+
* 29633: Doc/Zsh/func.yo, Src/parse.c, Test/C04funcdef.ztst: be
more careful that anonymous function syntax doesn't mess up
working syntax with other functions.
@@ -15195,5 +15199,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5414 $
+* $Revision: 1.5415 $
*****************************************************
diff --git a/Functions/Chpwd/zsh_directory_name_cdr b/Functions/Chpwd/zsh_directory_name_cdr
index 09aa35a93..c9be7db0c 100644
--- a/Functions/Chpwd/zsh_directory_name_cdr
+++ b/Functions/Chpwd/zsh_directory_name_cdr
@@ -18,7 +18,7 @@ elif [[ $1 = c ]]; then
values=(${${(f)"$(cdr -l)"}/ ##/:})
keys=(${values%%:*})
_describe -t dir-index 'recent directory index' \
- values keys -V unsorted -S']'
+ values -V unsorted -S']'
return
fi
fi
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 2e2749835..b1de6c6cc 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -607,7 +607,7 @@ callcompfunc(char *s, char *fn)
if (rdstr)
compredirect = rdstr;
kset |= CP_REDIRECT;
- } else
+ } else {
switch (linwhat) {
case IN_ENV:
compcontext = (linarr ? "array_value" : "value");
@@ -637,6 +637,7 @@ callcompfunc(char *s, char *fn)
aadd = 1;
}
}
+ }
compcontext = ztrdup(compcontext);
if (compwords)
freearray(compwords);
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 19787f9ff..999b2b7be 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -398,7 +398,18 @@ mod_export char *cmdstr;
/**/
mod_export char *varname;
-/* != 0 if we are in a subscript */
+/*
+ * != 0 if we are in a subscript.
+ * Of course, this being the completion code, you're expected to guess
+ * what the different numbers actually mean, but here's a cheat:
+ * 1: Key of an ordinary array
+ * 2: Key of a hash
+ * 3: Ummm.... this appears to be a special case of 2. After a lot
+ * of uncommented code looking for groups of brackets, we suddenly
+ * decide to set it to 2. The only upshot seems to be that compctl
+ * then doesn't add a matching ']' at the end, so I think it means
+ * there's one there already.
+ */
/**/
mod_export int insubscr;