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() {
43
43
fi
44
44
45
45
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
51
54
if [ -d " $line " ]; then
52
55
printf " %s/\n" " ${line%%/ } "
53
56
else
54
57
printf " %s\n" " $line "
55
58
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
59
62
60
63
if [[ -n " $dirpart " ]]; then
61
64
for i in " ${! pinyin_matched[@]} " ; do
You can’t perform that action at this time.
0 commit comments