about summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-17 09:06:05 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-17 09:06:05 +0000
commit5452be3a4ac5fcb587981625d1a4e5ccb503f652 (patch)
tree97313237f10c0c174b2bc27cf9b369b7529dfcac /Completion/Unix
parent027604400ba98f4c947784fc691dc7c93b9bf366 (diff)
downloadzsh-5452be3a4ac5fcb587981625d1a4e5ccb503f652.tar.gz
zsh-5452be3a4ac5fcb587981625d1a4e5ccb503f652.tar.xz
zsh-5452be3a4ac5fcb587981625d1a4e5ccb503f652.zip
15400
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Type/_path_files10
1 files changed, 9 insertions, 1 deletions
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index c7eaf2df2..598dc466b 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -264,7 +264,15 @@ else
   linepath=
   realpath=
 
-  if [[ "$pre[1]" = / ]]; then
+  if zstyle -s ":completion:${curcontext}:" preserve-prefix tmp1 &&
+     [[ -n "$tmp1" && "$pre" = (#b)(${~tmp1})* ]]; then
+
+    pre="$pre[${#match[1]}+1,-1]"
+    orig="$orig[${#match[1]}+1,-1]"
+    donepath="$match[1]"
+    prepaths=( '' )
+
+  elif [[ "$pre[1]" = / ]]; then
     # If it is a absolute path name, we remove the first slash and put it in
     # `donepath' meaning that we treat it as the path that was already handled.
     # Also, we don't use the paths from `-W'.