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

RFC/PATCH: Fix BSD package completion



with the last line uncommented (or the unmodified original), completing
/us<tab>
deletes the whole input. Presumably _files doesn't interact well with
adding the same strings in full with a raw compadd. I didn't try adding
something to $PKG_PATH so maybe the middle line breaks too. Fun fact,
that path/paths typo has been there since the initial commit in 2000,
and even so, $paths always contained a single empty element anyway.

To reproduce this on a non-bsd system, just set PACKAGES to some directory
that has All/*.tgz in it.

---
 Completion/BSD/Command/_bsd_pkg | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Completion/BSD/Command/_bsd_pkg b/Completion/BSD/Command/_bsd_pkg
index 9f4b0f1..200d99f 100644
--- a/Completion/BSD/Command/_bsd_pkg
+++ b/Completion/BSD/Command/_bsd_pkg
@@ -15,10 +15,10 @@ _bsd_pkg_pkgfiles() {
 
   pkgsdir=${PACKAGES:-$portsdir/packages}/All
 
-  paths=( "${(@)${(@s.:.)PKG_PATH}:#}" )
+  paths=( ${(@s.:.)PKG_PATH} )
   _files "$@" -g '*.t[bg]z(-.)' && ret=0
-  (( $#path )) && _files "$@" -W paths -g '*.t[bg]z(-.)' && ret=0
-  compadd "$@" - $pkgsdir/*.t[bg]z(-.) && ret=0
+  (( $#paths )) && _files "$@" -W paths -g '*.t[bg]z(-.)' && ret=0
+  #_wanted pkgs expl 'packages' compadd "$@" - $pkgsdir/*.t[bg]z(-.) && ret=0
 
   return ret
 }
-- 
2.2.0.GIT



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