Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug in accept-exact-dirs style
- X-seq: zsh-workers 26484
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh list <zsh-workers@xxxxxxxxxx>
- Subject: Re: bug in accept-exact-dirs style
- Date: Thu, 29 Jan 2009 08:20:25 -0800
- In-reply-to: <18815.40644.128711.97121@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <18815.40644.128711.97121@xxxxxxxxxxxxxxxxxx>
On Jan 27, 6:54pm, Greg Klanderman wrote:
}
} [~] greg@lwm| zsh -f
} lwm% mkdir foo
} lwm% touch foo/bar
} lwm% touch foo/baz
} lwm% autoload -U compinit
} lwm% compinit
} lwm% zstyle ':completion:*' accept-exact-dirs yes
}
} Now try completing each of the following:
}
} ls foo/ # OK
} ls ~/foo/ # doesn't work - no completions
} ls /home/greg/foo/ # OK
} ls $HOME/foo/ # doesn't work - no completions
This isn't directly related to accept-exact-dirs ... a prefix that
needs expansion is removed by _path_files in the section between the
comments
# Now let's have a closer look at the string to complete.
and
# Now we generate the matches. First we loop over all prefix paths given
# with the `-W' option.
The result after removing the prefix eventually ends up in $tmp1, so
when that is a string that will still pass the -d test in this loop:
while true; do
if [[ -d $donepath$tmp1 ]]; then
donepath=$donepath$tmp1/
pre=$tpre
break
elif [[ $tmp1 = (#b)(*)/([^/]#) ]]; then
tmp1=$match[1]
tpre=$match[2]/$tpre
else
break
fi
done
Then the code is fooled into thinking that the suffix is part of the
prefix, and on line 585 the PREFIX string is rebuilt in the wrong order,
becoming "tmp/~/" instead of "~/tmp/".
At that point I get lost, and I've already spent more time than I should
have looking at it. PWS? Anyone?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author