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

Re: two completion questions



Bart Schaefer wrote:

> ...
> 
> If you're using the new function-based completion in 3.1.6, it's going to
> require some editing of the _path_files completer.  Hey, Sven, do you (or
> any other zsh-workers) remember the rationale for this handling of ".."?

In _path_files it's because globbing never produces . and ..

About compctl: I only vaguely remember lots of discussions about these 
two special cases.


Anyway, here's the patch for _path_files, for the latest version.

To tell you the truth: this also fixes two typos that made files not
starting with a dot not be used as possible completions if glob_dots
was unset and the string on the line started with a dot.

Bye
 Sven

diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files	Mon Dec 13 11:24:11 1999
+++ Completion/Core/_path_files	Mon Dec 13 11:27:49 1999
@@ -225,11 +225,11 @@
     if [[ "$tpre$tsuf" = */* ]]; then
       tmp2=( ${^tmp1}*(-/) )
       [[ ! -o globdots && "$PREFIX" = .* ]] &&
-          tmp2=( "$tmp1[@]" ${^tmp1}.*(-/) )
+          tmp2=( "$tmp2[@]" ${^tmp1}.*(-/) . .. )
     else
       tmp2=( ${^tmp1}${^~pats} )
       [[ ! -o globdots && "$PREFIX" = .* ]] &&
-          tmp2=( "$tmp1[@]" ${^tmp1}.${^~pats} )
+          tmp2=( "$tmp2[@]" ${^tmp1}.${^~pats} . .. )
     fi
     tmp1=( "$tmp2[@]" )
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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