zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: approximation of absolute path in root directory
Date: Sat, 21 Jun 2008 22:31:45 +0100	[thread overview]
Message-ID: <5008.1214083905@pws-pc> (raw)

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/


                 reply	other threads:[~2008-06-21 21:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5008.1214083905@pws-pc \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).