* PATCH: Re: dev-19 -> 20: special-dirs changed?
@ 2000-05-25 12:00 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-05-25 12:00 UTC (permalink / raw)
To: zsh-workers; +Cc: Andy Spiegl
[ 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-05-25 12:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-25 12:00 PATCH: Re: dev-19 -> 20: special-dirs changed? Sven Wischnowsky
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).