mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-26 04:30:27 +01: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
|
|
@ -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…
Add table
Add a link
Reference in a new issue