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

PATCH: Re: bug in directory completion with tilde expansion?



Adam Spiers wrote:

> My funny combination of option settings strike again ...
> 
> This time the culprit seems to be glob_complete:
> 
>   $ zsh -f
>   $ echo $ZSH_VERSION
>   3.1.9-dev-8
>   $ autoload compinit; compinit
>   $ ls ~/soft<TAB>
>   $ ls ~/software/   <-- OK, trailing slash
>   $ setopt glob_complete
>   $ ls ~/soft<TAB>
>   $ ls ~/software    <-- broken, no trailing slash
> 
> The problem only exists for completion of tilde-prefixed paths.

Yes, that made it think the string was a pattern...

Bye
 Sven

Index: Completion/Core/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v
retrieving revision 1.35
diff -u -r1.35 _path_files
--- Completion/Core/_path_files	2000/11/08 09:20:43	1.35
+++ Completion/Core/_path_files	2001/02/13 09:20:46
@@ -622,7 +622,7 @@
         compquote tmp4 tmp1
       fi
       if [[ -z "$_comp_correct" && -n "$compstate[pattern_match]" &&
-            "$PREFIX$SUFFIX" = (|*[^\\])[][*?#~^\|\<\>]* ]]; then
+            "${PREFIX#\~}$SUFFIX" = (|*[^\\])[][*?#~^\|\<\>]* ]]; then
         compadd -Qf -W "$prepath$realpath" "$pfxsfx[@]" "$mopts[@]" \
                 -M "r:|/=* r:|=*" - "$linepath$tmp4${(@)^tmp1}"
       else

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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