zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Cc: Andy Spiegl <zsh.Andy@spiegl.de>
Subject: PATCH: Re: dev-19 -> 20: special-dirs changed?
Date: Thu, 25 May 2000 14:00:11 +0200 (MET DST)	[thread overview]
Message-ID: <200005251200.OAA02522@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Andy Spiegl's message of Thu, 25 May 2000 12:46:44 +0200


[ moved to zsh-workers ]

Andy Spiegl wrote:

> Bart Schaefer wrote:
> > _path_files now recognizes special-dirs only when one of -f or -/ is used.
> > The doc says that -f means "complete all files."  However, _files always
> > calls `_path_files -g ...' so there's no way to get special-dirs to be
> > recognized for default file completions.
> > 
> > This is presumably a bug, but whether it's a bug in _path_files or _files
> > I don't know.
> 
> Hm, haven't heard anything about this issue since.  Did it make it onto
> the bug list?  I still find it pretty annoying that completion doesn't
> work in these cases. :-(
> 
> I investigated a little more:
> Here are cases where no slash is appended after hitting TAB:
> cd bar/..
> mv foo ..
> mv foo ../bar/..
> ls ..
> ls ../bar/..

Oops, indeed. Seems like I forgot to fix that, sorry.

Bye
 Sven

Index: Completion/Core/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v
retrieving revision 1.14
diff -u -r1.14 _path_files
--- Completion/Core/_path_files	2000/05/16 11:24:55	1.14
+++ Completion/Core/_path_files	2000/05/25 11:59:42
@@ -142,6 +142,9 @@
 zstyle -s ":completion:${curcontext}:paths" special-dirs sdirs &&
     [[ "$sdirs" = (yes|true|on|1) ]] && sdirs=yes
 
+[[ "$pats" = ((|*[[:blank:]])\*(|[[:blank:]]*)|*\([^[:blank:]]#/[^[:blank:]]#\)*) ]] &&
+    sopt=$sopt/
+
 zstyle -s ":completion:${curcontext}:files" ignore-parents ignpar
 
 # We get the prefix and the suffix from the line and save the whole
@@ -293,9 +296,9 @@
       fi
       if [[ -n "$sdirs" && ( -o globdots || "$PREFIX" = .* ) ]]; then
 	if [[ "$sdirs" = yes ]]; then
-	  tmp1=( "$tmp1[@]" . .. )
+	  tmp1=( "$tmp1[@]" $^tmp2${skipped}{.,..} )
 	elif [[ "$sdirs" = .. ]]; then
-	  tmp1=( "$tmp1[@]" .. )
+	  tmp1=( "$tmp1[@]" $^tmp2${skipped}.. )
         fi
       fi
     else
@@ -304,13 +307,12 @@
       else
         tmp1=( ${^tmp1}${skipped}${^~pats} )
       fi
-      if [[ -n "$sdirs" &&
-            ( "$sopt" = *[/f]* || "$pats" = *\([^[:blank:]]#/[^[:blank:]]#\)* ) &&
+      if [[ -n "$sdirs" && "$sopt" = *[/f]* &&
             ( -o globdots || "$PREFIX" = .* ) ]]; then
 	if [[ "$sdirs" = yes ]]; then
-	  tmp1=( "$tmp1[@]" . .. )
+	  tmp1=( "$tmp1[@]" $^tmp2${skipped}{.,..} )
 	elif [[ "$sdirs" = .. ]]; then
-	  tmp1=( "$tmp1[@]" .. )
+	  tmp1=( "$tmp1[@]" $^tmp2${skipped}.. )
         fi
       fi
     fi

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2000-05-25 12:00 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=200005251200.OAA02522@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    --cc=zsh.Andy@spiegl.de \
    /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).