* RFC/PATCH: Fix BSD package completion
@ 2015-02-19 9:50 Mikael Magnusson
0 siblings, 0 replies; only message in thread
From: Mikael Magnusson @ 2015-02-19 9:50 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-02-19 10:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-19 9:50 RFC/PATCH: Fix BSD package completion Mikael Magnusson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).