summaryrefslogtreecommitdiff
path: root/Completion/Base/Completer
diff options
context:
space:
mode:
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} ..." )