zsh-workers
 help / color / mirror / code / Atom feed
* Possible bug with cd completion
@ 2001-08-09  9:38 martin.ebourne
  2001-08-09 15:52 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: martin.ebourne @ 2001-08-09  9:38 UTC (permalink / raw)
  To: zsh-workers


Hi,

There seems to be a bug with completing directories to cd which are
numbers.
ie.

% zsh -f
% echo $ZSH_VERSION
4.0.2
% autoload -U compinit
% compinit
% setopt cdablevars
% pushd
~ ~/test
% mkdir 100
% cd 1

Pressing <tab> immediately after the 1 offers no completions. Add a 0 and
it works.

This seems to be a problem with the handling of cdablevars in _cd. It seems
to be trying to complete with a '~' prefixed, which hits the directory
stack. However, cdable vars doesn't actually do that when you execute the
cd itself.

Cheers,

Martin.




This e-mail message is CONFIDENTIAL and may contain legally privileged
information.  If you are not the intended recipient you should not  read,
copy, distribute, disclose or otherwise use the information in this e-mail.
Please also telephone or fax us immediately and delete the message from
your system.  E-mail may be susceptible to data corruption, interception
and unauthorised amendment, and we do not accept liability for any such
corruption, interception or amendment or the consequences thereof.


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

* Re: Possible bug with cd completion
  2001-08-09  9:38 Possible bug with cd completion martin.ebourne
@ 2001-08-09 15:52 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2001-08-09 15:52 UTC (permalink / raw)
  To: martin.ebourne, zsh-workers

On Aug 9, 10:38am, martin.ebourne@arcordia.com wrote:
}
} This seems to be a problem with the handling of cdablevars in _cd.

Try this:

Index: Completion/Zsh/Command/_cd
===================================================================
--- Completion/Zsh/Command/_cd	2001/06/27 16:40:02	1.3
+++ Completion/Zsh/Command/_cd	2001/08/09 15:50:44
@@ -36,7 +36,7 @@
     tmpcdpath=(${${(@)cdpath:#.}:#$PWD})
 
     # With cdablevars, we can complete foo as if ~foo/
-    if [[ -o cdablevars && -n "$PREFIX" ]]; then
+    if [[ -o cdablevars && -n "$PREFIX" && "$PREFIX" != <-> ]]; then
       if [[ "$PREFIX" != */* ]]; then
         _tilde && ret=0
       else

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

end of thread, other threads:[~2001-08-09 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-09  9:38 Possible bug with cd completion martin.ebourne
2001-08-09 15:52 ` Bart Schaefer

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).