mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-18 15:21:16 +02:00
33843: minor optimisation for recursive-files.
Expand the recursive path only the first time we need it.
This commit is contained in:
parent
09959eb9d6
commit
a4799145da
2 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-12-08 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 33843: Completion/Unix/Type/_files: minor optimisation for
|
||||
recursive-files.
|
||||
|
||||
2014-12-07 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 33912: Completion/Unix/Command/_od: fix filename default case
|
||||
|
|
|
@ -121,9 +121,13 @@ for def in "$pats[@]"; do
|
|||
if _path_files -g "$pat" "$opts[@]" "$expl[@]"; then
|
||||
ret=0
|
||||
elif [[ $PREFIX$SUFFIX != */* ]] && zstyle -a ":completion:${curcontext}:$tag" recursive-files rfiles; then
|
||||
local subtree
|
||||
for rfile in $rfiles; do
|
||||
if [[ $PWD/ = ${~rfile} ]]; then
|
||||
for prepath in **/*(/); do
|
||||
if [[ -z $subtree ]]; then
|
||||
subtree=( **/*(/) )
|
||||
fi
|
||||
for prepath in $subtree; do
|
||||
oprefix=$PREFIX
|
||||
PREFIX=$prepath/$PREFIX
|
||||
_path_files -g "$pat" "$opts[@]" "$expl[@]" && ret=0
|
||||
|
|
Loading…
Reference in a new issue