* PATCH: approximation of absolute path in root directory
@ 2008-06-21 21:31 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2008-06-21 21:31 UTC (permalink / raw)
To: Zsh hackers list
Dispatches from Maintenance Nightmare Central:
/uzr/bin/em<TAB> -> //uzr/bin/em
even with approximation, which isn't quite what you want (and it happens
with just /uzr, too). Luckily this one seems to be easy: don't update
the directory-so-far if it's still only /, otherwise this gets added as
an extra path element and becomes the offered completion before we even
get to approximation.
I found this when looking for the problem with approximation of files
beginning with a '.', but that one seems to arise from a lower circle of
Hell ("It Came From Compadd; Only The Compiler Could Stop It").
Index: Completion/Unix/Type/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_path_files,v
retrieving revision 1.30
diff -u -r1.30 _path_files
--- Completion/Unix/Type/_path_files 4 Jun 2008 10:12:03 -0000 1.30
+++ Completion/Unix/Type/_path_files 21 Jun 2008 21:26:16 -0000
@@ -414,7 +414,7 @@
fi
if (( ! $#tmp1 )); then
- tmp2=( ${^tmp2}/$PREFIX$SUFFIX )
+ tmp2=( ${^${tmp2:#/}}/$PREFIX$SUFFIX )
elif [[ "$tmp1[1]" = */* ]]; then
if [[ -n "$_comp_correct" ]]; then
tmp2=( "$tmp1[@]" )
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-21 21:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-21 21:31 PATCH: approximation of absolute path in root directory 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).