zsh-workers
 help / color / mirror / code / Atom feed
* Patch (?) for _path_files
@ 2011-05-06 15:05 Bart Schaefer
  2011-05-08 17:37 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2011-05-06 15:05 UTC (permalink / raw)
  To: zsh-workers

I believe this has to do with the thread "Re: Another _path_files bug?"
from the first couple of weeks of February 2011.

--- ../zsh-forge/current/Completion/Unix/Type/_path_files       2011-02-13 10:44
:16 -0800
+++ ./Completion/Unix/Type/_path_files  2011-02-13 10:51:33 -0800
@@ -751,10 +751,11 @@
       [[ "$tsuf" != /* ]] && mid="$testpath"
       if [[ -z "$_comp_correct" && -n "$compstate[pattern_match]" &&
             "$tmp2" = (|*[^\\])[][*?#~^\|\<\>]* ]]; then
-        cpre="${cpre}${tmp1[1]%%/*}/"
+        cpre="${cpre}${tmp1[1]%%/*}"
       else
-        cpre="${cpre}${tpre}/"
+        cpre="${cpre}${tpre}"
       fi
+      [[ "$tsuf" = /* ]] && cpre+=/
       tpre="${tsuf#*/}"
       tsuf=
     else

I backed out most of my scratch work from that thread when PWS posted
workers/28750, but kept this bit -- for reasons that sadly I now no
longer remember.  It avoids appending a slash to the common prefix (if
I recall correctly what cpre means, which I may not) unless there was
a leading slash on the tested suffix (again IIRC tsuf).  I suspect
this was meant to prevent double slash appearing in some completions.

Any opinions on whether this is correct/useful?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-08 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-06 15:05 Patch (?) for _path_files Bart Schaefer
2011-05-08 17:37 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).