diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-07-30 08:42:55 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-07-30 08:42:55 +0000 |
commit | 75d5e9bb8b42282935f54b6d4750aea7ae6d5844 (patch) | |
tree | 4f69df50376c8103fd4d3e5a086845f93310396b | |
parent | 1619df1c5d797c3b25fc3224e49cac358c7450f6 (diff) | |
download | zsh-75d5e9bb8b42282935f54b6d4750aea7ae6d5844.tar.gz zsh-75d5e9bb8b42282935f54b6d4750aea7ae6d5844.tar.xz zsh-75d5e9bb8b42282935f54b6d4750aea7ae6d5844.zip |
(15526)
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Completion/Base/Utility/_arguments | 8 | ||||
-rw-r--r-- | Src/Zle/computil.c | 8 |
3 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog index 6f7418026..4f8801e50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-07-30 Sven Wischnowsky <wischnow@zsh.org> + + * 15526: Completion/Base/Utility/_arguments, Src/Zle/computil.c: + change order in which compgroups adds groups; add comment to + _arguments trying to explain how and why the return value is + wrong + 2001-07-28 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> * 15511: Functions/Misc/zcalc, Doc/Zsh/contrib.yo: make diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index 006e80374..0551afcf2 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -428,6 +428,14 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then if [[ -n "$aret" ]]; then [[ -n $rawret ]] && return 300 + +### Returning non-zero would allow the calling function to add its own +### completions if we generated only options and have to use a ->state +### action. But if that then doesn't generate matches, the calling +### function's return value would be wrong unless it compares +### $compstate[nmatches] to its previous value. Ugly. +### +### return 1 else [[ -n "$noargs" && nm -eq "$compstate[nmatches]" ]] && _message "$noargs" fi diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 552f5f745..12fafc71d 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -4281,9 +4281,7 @@ bin_compgroups(char *nam, char **args, char *ops, int func) SWITCHHEAPS(oldheap, compheap) { while ((n = *args++)) { endcmgroup(NULL); - begcmgroup(n, 0); - endcmgroup(NULL); - begcmgroup(n, CGF_NOSORT); + begcmgroup(n, CGF_NOSORT|CGF_UNIQCON); endcmgroup(NULL); begcmgroup(n, CGF_UNIQALL); endcmgroup(NULL); @@ -4291,7 +4289,9 @@ bin_compgroups(char *nam, char **args, char *ops, int func) endcmgroup(NULL); begcmgroup(n, CGF_UNIQALL); endcmgroup(NULL); - begcmgroup(n, CGF_NOSORT|CGF_UNIQCON); + begcmgroup(n, CGF_NOSORT); + endcmgroup(NULL); + begcmgroup(n, 0); } } SWITCHBACKHEAPS(oldheap); |