about summary refs log tree commit diff
path: root/Completion/Unix/Command/_look
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-06-25 09:03:04 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-06-25 09:03:04 +0000
commita267832ddf4150652fde3936858841bb2edbd9ae (patch)
tree961f0cbcaf8dbdaf2ff2e1a5409d644158f592bf /Completion/Unix/Command/_look
parentdd54fb249881fa882319cd2642780dcebb8d9f7c (diff)
downloadzsh-a267832ddf4150652fde3936858841bb2edbd9ae.tar.gz
zsh-a267832ddf4150652fde3936858841bb2edbd9ae.tar.xz
zsh-a267832ddf4150652fde3936858841bb2edbd9ae.zip
18631: returning too early breaks prefix-needed style set to false
Diffstat (limited to 'Completion/Unix/Command/_look')
-rw-r--r--Completion/Unix/Command/_look17
1 files changed, 6 insertions, 11 deletions
diff --git a/Completion/Unix/Command/_look b/Completion/Unix/Command/_look
index b80a70824..825488c37 100644
--- a/Completion/Unix/Command/_look
+++ b/Completion/Unix/Command/_look
@@ -1,6 +1,6 @@
 #compdef look
 
-local curcontext="$curcontext" state line
+local curcontext="$curcontext" state line ret=1
 typeset -A opt_args
 
 _arguments -C -s \
@@ -8,14 +8,9 @@ _arguments -C -s \
   '-f[case insensitive]' \
   '-d[dictionary order]' \
   ':string:->string' \
-  ':dictionary file:_files' && return 0
+  ':dictionary file:_files' && ret=0
 
-case "$state" in
-string)
-  if [[ -n "$PREFIX" ]]; then
-    _wanted values expl 'word prefix' compadd - $(_call_program values $words[1] $PREFIX)
-  else
-    _message -e prefixes 'word prefix'
-  fi
-  ;;
-esac
+[[ -n "$state" && ! -prefix - ]] && _wanted values expl 'word prefix' \
+    compadd - $(_call_program words $words[1] '"$PREFIX"') && return
+
+return ret