summaryrefslogtreecommitdiff
path: root/Completion/Base/Completer
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2016-12-04 04:32:03 +0100
committerAxel Beckert <abe@deuxchevaux.org>2016-12-04 04:32:03 +0100
commit3e439c3863f14c82f70666804c8570a13b3732e6 (patch)
tree07036c43e0f3f9242bb6dd42cd2a849ec8ea8aca /Completion/Base/Completer
parent2aedc4b88fd0e87b89583983951b04b96f48efd3 (diff)
parent7b7e84f0815ed22a0ee348a217776529035dccf3 (diff)
downloadzsh-3e439c3863f14c82f70666804c8570a13b3732e6.tar.gz
zsh-3e439c3863f14c82f70666804c8570a13b3732e6.zip
Merge tag 'zsh-5.2-test-1' into debian
Diffstat (limited to 'Completion/Base/Completer')
-rw-r--r--Completion/Base/Completer/_expand9
-rw-r--r--Completion/Base/Completer/_external_pwds8
-rw-r--r--Completion/Base/Completer/_user_expand11
3 files changed, 21 insertions, 7 deletions
diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand
index e52144cb7..a6e30e891 100644
--- a/Completion/Base/Completer/_expand
+++ b/Completion/Base/Completer/_expand
@@ -181,7 +181,7 @@ if [[ -z "$compstate[insert]" ]] ;then
else
_tags all-expansions expansions original
- if [[ $#exp -gt 1 ]] && _requested expansions; then
+ if [[ $#exp -ge 1 ]] && _requested expansions; then
local i j normal space dir
if [[ "$sort" = menu ]]; then
@@ -207,9 +207,14 @@ else
(( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space
(( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal
fi
- if _requested all-expansions expl 'all expansions'; then
+ if _requested all-expansions; then
local disp dstr
+ if [[ "$sort" = menu ]]; then
+ _description all-expansions expl 'all expansions' "o:$word"
+ else
+ _description -V all-expansions expl 'all expansions' "o:$word"
+ fi
if [[ "${#${exp}}" -ge COLUMNS ]]; then
disp=( -ld dstr )
dstr=( "${(r:COLUMNS-5:)exp} ..." )
diff --git a/Completion/Base/Completer/_external_pwds b/Completion/Base/Completer/_external_pwds
index 4ad50f02b..dfc1abe16 100644
--- a/Completion/Base/Completer/_external_pwds
+++ b/Completion/Base/Completer/_external_pwds
@@ -22,9 +22,13 @@ case $OSTYPE in
)
;;
linux*)
- dirs=( /proc/${^$(pidof zsh):#$$}/cwd(N:A) )
+ dirs=( /proc/${^$(pidof -- -zsh zsh):#$$}/cwd(N:P) )
dirs=( $^dirs(N^@) )
;;
+ freebsd*)
+ dirs=( $(pgrep -U $UID -x zsh) )
+ dirs=( $(procstat -h -f $dirs|awk '{if ($3 == "cwd") print $NF}') )
+ ;;
*)
if (( $+commands[lsof] )); then
dirs=( ${${${(M)${(f)"$(lsof -a -u $EUID -c zsh -p \^$$ -d cwd -F n -w
@@ -32,7 +36,7 @@ case $OSTYPE in
fi
;;
esac
-dirs=( ${(D)dirs} )
+dirs=( ${(D)dirs:#$PWD} )
compstate[pattern_match]='*'
_wanted directories expl 'current directory from other shell' \
diff --git a/Completion/Base/Completer/_user_expand b/Completion/Base/Completer/_user_expand
index cf3d172f0..ee39bb176 100644
--- a/Completion/Base/Completer/_user_expand
+++ b/Completion/Base/Completer/_user_expand
@@ -27,7 +27,7 @@ exp=("$word")
# Now look for user completions.
-zstyle -a ":completion:${curcontext}" user-expand specs || return 1
+zstyle -a ":completion:${curcontext}:" user-expand specs || return 1
for spec in $specs; do
REPLY=
@@ -95,7 +95,7 @@ if [[ -z "$compstate[insert]" ]] ;then
else
_tags all-expansions expansions original
- if [[ $#exp -gt 1 ]] && _requested expansions; then
+ if [[ $#exp -ge 1 ]] && _requested expansions; then
local i j normal space dir
if [[ "$sort" = menu ]]; then
@@ -121,9 +121,14 @@ else
(( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space
(( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal
fi
- if _requested all-expansions expl "all expansions${REPLY:+: $REPLY}"; then
+ if _requested all-expansions; then
local disp dstr
+ if [[ "$sort" = menu ]]; then
+ _description all-expansions expl "all expansions${REPLY:+: $REPLY}" "o:$word"
+ else
+ _description -V all-expansions expl "all expansions${REPLY:+: $REPLY}" "o:$word"
+ fi
if [[ "${#${exp}}" -ge COLUMNS ]]; then
disp=( -ld dstr )
dstr=( "${(r:COLUMNS-5:)exp} ..." )