about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-13 08:09:49 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-13 08:09:49 +0000
commit45051d58ab773ebd65f1ec07e58d1b43587d1a4f (patch)
tree1f17f555babedf743c135c4c8b0302b2c7f232b7 /Completion
parent73d0e1adb18b095fcba9527fab0c865ab7f25e30 (diff)
downloadzsh-45051d58ab773ebd65f1ec07e58d1b43587d1a4f.tar.gz
zsh-45051d58ab773ebd65f1ec07e58d1b43587d1a4f.tar.xz
zsh-45051d58ab773ebd65f1ec07e58d1b43587d1a4f.zip
make _files not use its own description if there is one from a calling function; improve -P-prefix handling in _path_files (15389)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Type/_files6
-rw-r--r--Completion/Unix/Type/_path_files8
2 files changed, 11 insertions, 3 deletions
diff --git a/Completion/Unix/Type/_files b/Completion/Unix/Type/_files
index a291ee786..87234eb2d 100644
--- a/Completion/Unix/Type/_files
+++ b/Completion/Unix/Type/_files
@@ -65,7 +65,11 @@ for def in "$pats[@]"; do
     if [[ "$sdef" = *:${tag}:* ]]; then
       descr="${(Q)sdef#*:${tag}:}"
     else
-      descr=file
+      if (( $opts[(I)-X] )); then
+        descr=
+      else
+        descr=file
+      fi
       end=yes
     fi
 
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 9cf7e2d9e..0e1f9fe3f 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_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 cfopt listsfx
+local pats haspats ignore pfx pfxsfx sopt gopt opt sdirs ignpar cfopt listsfx
 local nm=$compstate[nmatches] menu matcher mopts sort match mid accex fake
 
 typeset -U prepaths exppaths
@@ -15,7 +15,7 @@ exppaths=()
 # Get the options.
 
 zparseopts -a mopts \
-    'P:=pfxsfx' 'S:=pfxsfx' 'q=pfxsfx' 'r:=pfxsfx' 'R:=pfxsfx' \
+    'P:=pfx' 'S:=pfxsfx' 'q=pfxsfx' 'r:=pfxsfx' 'R:=pfxsfx' \
     'W:=prepaths' 'F:=ignore' 'M+:=matcher' \
     J+: V+: X+: 1: 2: n: 'f=tmp1' '/=tmp1' 'g+:-=tmp1'
 
@@ -29,6 +29,10 @@ else
 fi
 pats=( "${(@)pats:# #}" )
 
+if (( $#pfx )); then
+  compset -P "$pfx[2]" || pfxsfx=( "$pfx[@]" "$pfxsfx[@]" )
+fi
+
 if (( $#prepaths )); then
   tmp1="${prepaths[2]}"
   if [[ "$tmp1[1]" = '(' ]]; then