Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Completion: Small fixes for _files, _object_files



I noticed that _object_files doesn't respect the description set through
_arguments, nor the default one in the function itself. This seems to fix it
(and i made a similar change in _files) — i *think* this is the order these
should be passed in generally, isn't it?

dana


diff --git a/Completion/Unix/Type/_files b/Completion/Unix/Type/_files
index 2b0c5580a..5df22ea46 100644
--- a/Completion/Unix/Type/_files
+++ b/Completion/Unix/Type/_files
@@ -121,7 +121,7 @@ for def in "$pats[@]"; do
      done
    fi
         else
-          _path_files "$expl[@]" -g "$pat" "$opts[@]" && ret=0
+          _path_files -g "$pat" "$opts[@]" "$expl[@]" && ret=0
         fi
       done
       (( ret )) || break

diff --git a/Completion/Unix/Type/_object_files b/Completion/Unix/Type/_object_files
index 595265116..6b931372f 100644
--- a/Completion/Unix/Type/_object_files
+++ b/Completion/Unix/Type/_object_files
@@ -9,4 +9,4 @@ __object_file() {
  $REPLY = (core*|*.core) ]]
 }
 
-_files -g '*(-.e,__object_file,)'
+_files -g '*(-.e,__object_file,)' "$@" "${(@)expl}"



Messages sorted by: Reverse Date, Date, Thread, Author