From 171855e2e23938f40080ca2630d2efc42f319014 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Thu, 31 May 2001 12:38:34 +0000 Subject: fix tag-order problem with _arguments (completion after an option that gets an argument in the same word); and a fix for completion after -ab, where -a gets an argument in the next word and -b gets one in the same word (14607) --- Completion/Base/Utility/_arguments | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Completion/Base') diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index 3bd95687d..209785f2d 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -233,7 +233,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then descr="$descrs[anum]" subc="$subcs[anum++]" - if [[ -n "$matched" ]] || _requested "$subc"; then + if [[ -z "$tried" ]] && { [[ -n "$matched" ]] || _requested "$subc" }; then curcontext="${oldcontext%:*}:$subc" @@ -328,7 +328,8 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then fi done if [[ -z "$hasopts" && - ( -z "$matched" || -n "$alwopt" ) && + -z "$matched" && + ( -z "$tried" || -n "$alwopt" ) && ( -z "$aret" || "$PREFIX" = "$origpre" ) ]] && _requested options && { ! zstyle -T ":completion:${curcontext}:options" prefix-needed || @@ -389,7 +390,8 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then [[ -n "$tried" && "${${alwopt:+$origpre}:-$PREFIX}" != [-+]* ]] && break done if [[ -n "$opts" && -z "$aret" && - ( -z "$matched$mesg" || -n "$alwopt" ) && + -z "$matched" && + ( -z "$tried" || -n "$alwopt" ) && nm -eq compstate[nmatches] ]]; then PREFIX="$origpre" -- cgit 1.4.1