Skip to content

Commit

Permalink
respect _files -/ in recursive completions (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
romkatv committed Mar 1, 2022
1 parent 0e79264 commit 46a4a67
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fn/z4h-fzf-complete
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ done
local -a opts files dirs pats ignore
zparseopts -a mopts f=files /=dirs g+:=pats F:=ignore \
P: S: q r: R: W: M+: J+: V+: x+: X+: 1 2 o+: n
local -i patdirs=${#pats}
while (( ${#pats} )); do
if [[ ${pats[2]} != ('*(-/)'|'*(#q-/)') ]]; then
patdirs=0
break
fi
builtin shift 2 pats
done
(( patdirs )) && dirs=(-/)
(( ${#files} || ! ${#dirs} )) && typeset -gi _z4h_only_dirs=0
} "$@"
local -ir _z4h_in_path_files=1
Expand Down

0 comments on commit 46a4a67

Please sign in to comment.