about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-13 09:05:35 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-13 09:05:35 +0000
commitcedd1006e661b990aaa8881c2efd4116bed574a3 (patch)
tree0d38ad379e55e3b1f9388a5fc661753de65c30a6 /Completion
parent055d961f84fcfb430aceb40bdb7932d962b143e9 (diff)
downloadzsh-cedd1006e661b990aaa8881c2efd4116bed574a3.tar.gz
zsh-cedd1006e661b990aaa8881c2efd4116bed574a3.tar.xz
zsh-cedd1006e661b990aaa8881c2efd4116bed574a3.zip
fixes for calling compfiles, for completing words with special characters; make compfiles optimisations work with globcomplete and simple match (sunsite isn't responding)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Core/_path_files11
1 files changed, 6 insertions, 5 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 5673e7c4a..7f6f83184 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -5,7 +5,7 @@
 
 local linepath realpath donepath prepath testpath exppath skips skipped
 local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre
-local pats haspats ignore pfxsfx sopt gopt opt sdirs ignpar
+local pats haspats ignore pfxsfx sopt gopt opt sdirs ignpar cfopt
 local nm=$compstate[nmatches] menu matcher mopts sort match mid
 
 typeset -U prepaths exppaths
@@ -185,6 +185,7 @@ eorig="$orig"
 [[ $compstate[insert] = (*menu|[0-9]*) || -n "$_comp_correct" ||
    ( -n "$compstate[pattern_match]" &&
      "${orig#\~}" != (|*[^\\])[][*?#~^\|\<\>]* ) ]] && menu=yes
+[[ -n "$_comp_correct" ]] && cfopt=-
 
 # Now let's have a closer look at the string to complete.
 
@@ -222,7 +223,7 @@ if [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then
     elif [[ tmp -le $#dirstack ]]; then
       realpath=$dirstack[tmp]/
     else
-      _message 'not directory stack entries'
+      _message 'not enough directory stack entries'
       return 1
     fi
   elif [[ "$linepath" = [-+] ]]; then
@@ -313,11 +314,11 @@ for prepath in "$prepaths[@]"; do
     # Get the matching files by globbing.
 
     if [[ "$tpre$tsuf" = */* ]]; then
-      compfiles -P tmp1 "$skipped" "$_matcher" "$sdirs"
+      compfiles -P$cfopt tmp1 "$skipped" "$_matcher" "$sdirs"
     elif [[ "$sopt" = *[/f]* ]]; then
-      compfiles -p tmp1 "$skipped" "$_matcher" "$sdirs" "$pats"
+      compfiles -p$cfopt tmp1 "$skipped" "$_matcher" "$sdirs" "$pats[@]"
     else
-      compfiles -p tmp1 "$skipped" "$_matcher" '' "$pats"
+      compfiles -p$cfopt tmp1 "$skipped" "$_matcher" '' "$pats[@]"
     fi
     tmp1=( $~tmp1 )