summaryrefslogtreecommitdiff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-05 11:18:36 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-05 11:18:36 +0000
commit22d506ed6b0a9ef5b9dba6fa81d74182ca890ff0 (patch)
treefbeee7f77033f663a3802c0b24f7cfc01e7627ee /Completion/Unix
parent7a1139b5e01ef5be26b5290d3e8518f0af2c2d1b (diff)
downloadzsh-22d506ed6b0a9ef5b9dba6fa81d74182ca890ff0.tar.gz
zsh-22d506ed6b0a9ef5b9dba6fa81d74182ca890ff0.zip
make expand style (file completion) work again; no more special behaviour with menu completion; try to make docs clearer (15944)
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Type/_path_files15
1 files changed, 11 insertions, 4 deletions
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 805f6993e..811e63173 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -332,6 +332,8 @@ for prepath in "$prepaths[@]"; do
# Get the matching files by globbing.
+ tmp2=( "$tmp1[@]" )
+
if [[ "$tpre$tsuf" = */* ]]; then
compfiles -P$cfopt tmp1 accex "$skipped" "$_matcher" "$sdirs" fake
elif [[ "$sopt" = *[/f]* ]]; then
@@ -344,7 +346,9 @@ for prepath in "$prepaths[@]"; do
if [[ -n "$PREFIX$SUFFIX" ]]; then
# See which of them match what's on the line.
- if [[ "$tmp1[1]" = */* ]]; then
+ if (( ! $#tmp1 )); then
+ tmp2=( ${^tmp2}/$PREFIX$SUFFIX )
+ elif [[ "$tmp1[1]" = */* ]]; then
if [[ -n "$_comp_correct" ]]; then
tmp2=( "$tmp1[@]" )
builtin compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp1:t}"
@@ -505,12 +509,15 @@ for prepath in "$prepaths[@]"; do
SUFFIX="$osuf"
fi
- if [[ -n $menu || -z "$compstate[insert]" ]] ||
- ! zstyle -t ":completion:${curcontext}:paths" expand suffix ||
+ # This once tested `-n $menu ||' but our menu-completion expert says
+ # that's not what we want.
+
+ if [[ -z "$compstate[insert]" ]] ||
+ { ! zstyle -t ":completion:${curcontext}:paths" expand suffix &&
[[ -z "$listsfx" &&
( -n "$_comp_correct" ||
-z "$compstate[pattern_match]" || "$SUFFIX" != */* ||
- "${SUFFIX#*/}" = (|*[^\\])[][*?#~^\|\<\>]* ) ]]; then
+ "${SUFFIX#*/}" = (|*[^\\])[][*?#~^\|\<\>]* ) ]] }; then
(( tmp4 )) && zstyle -t ":completion:${curcontext}:paths" ambiguous &&
compstate[to_end]=
if [[ "$tmp3" = */* ]]; then