From 5452be3a4ac5fcb587981625d1a4e5ccb503f652 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 17 Jul 2001 09:06:05 +0000 Subject: 15400 --- Completion/Unix/Type/_path_files | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Type') 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'. -- cgit 1.4.1