Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Path completion causing ambiguous path tail to disappear



Bart Schaefer wrote:

> This is not exactly a complaint, because I can (almost) get the behavior I
> want by using a style ... rather it's a question of whether the default
> behavior should be different.
> 
> I have my zsh sources under /usr/src/local/zsh/.  With dev-19:
> 
> zagzig[36] cd /usr/s/l/<TAB>
> 
> The valid completions at this point should be
> 
> /usr/src/local	/usr/src/linux /usr/share/libtool /usr/share/locale
> 
> However, what happens is that the word on the command line is *shortened*,
> leaving me with
> 
> zagzig[36] cd /usr/s/
> 
> with the cursor on top of the final `/'.  Now, I don't mind the cursor
> moving back to that point if that's where I need to disambiguate, but I
> was surprised that zsh deleted the tail of the path rather than simply
> feeping, or displaying the list.

Slight problem with building the correct $SUFFIX for testing.

Bye
 Sven

diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files	Fri Feb 18 15:42:42 2000
+++ Completion/Core/_path_files	Mon Feb 21 10:11:36 2000
@@ -420,13 +420,13 @@
     fi
 
     if [[ "$tpre" = */* ]]; then
-      PREFIX="${donepath}${linepath}${cpre}${tpre%%/*}"
-      SUFFIX="/${tsuf#*/}"
       tmp2="${cpre}${tpre%%/*}"
+      PREFIX="${donepath}${linepath}${tmp2}"
+      SUFFIX="/${tpre#*/}${tsuf#*/}"
     else
-      PREFIX="${donepath}${linepath}${cpre}${tpre}"
-      SUFFIX="${tsuf}"
       tmp2="${cpre}${tpre}"
+      PREFIX="${donepath}${linepath}${tmp2}"
+      SUFFIX="${tsuf}"
     fi
 
     if (( tmp4 )) ||

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author