File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -43,19 +43,22 @@ _comp_compgen_filedir() {
4343 fi
4444
4545 local -a pinyin_matched
46- mapfile -t pinyin_matched < <(
47- compgen " ${compgen_opts[@]} " -- " " | while IFS= read -r line; do
48- if [[ " ${compgen_opts[0]} " == -d ]]; then
49- printf " %s/\n" " ${line%%/ } "
50- else
46+ if [[ " ${compgen_opts[0]} " == -d ]]; then
47+ mapfile -t pinyin_matched < <(
48+ compgen -d -- |
49+ bash-pinyin-completion-rs " $basepart " 2> /dev/null
50+ )
51+ else
52+ mapfile -t pinyin_matched < <(
53+ compgen -f -- | while IFS= read -r line; do
5154 if [ -d " $line " ]; then
5255 printf " %s/\n" " ${line%%/ } "
5356 else
5457 printf " %s\n" " $line "
5558 fi
56- fi
57- done | bash-pinyin-completion-rs " $basepart " 2> /dev/null
58- )
59+ done | bash-pinyin-completion-rs " $basepart " 2> /dev/null
60+ )
61+ fi
5962
6063 if [[ -n " $dirpart " ]]; then
6164 for i in " ${! pinyin_matched[@]} " ; do
You can’t perform that action at this time.
0 commit comments