Skip to content

Commit 43c4fcf

Browse files
committed
fix: patch _comp_compgen_filedir_xspec() for non-builtin cmd
Signed-off-by: wxiwnd <[email protected]>
1 parent 011b532 commit 43c4fcf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/bash_pinyin_completion

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ if ! declare -F _comp_compgen_filedir &>/dev/null; then
1111
fi
1212

1313
eval "function __bak_comp_compgen_filedir() { $(declare -f _comp_compgen_filedir | tail -n +2) }"
14+
eval "function __bak_comp_compgen_filedir_xspec() { $(declare -f _comp_compgen_filedir_xspec | tail -n +2) }"
1415

1516
# replace _comp_compgen_filedir
1617
_comp_compgen_filedir() {
1718
__bak_comp_compgen_filedir "$@"
19+
_pinyin_completion "$@"
20+
}
21+
22+
_comp_compgen_filedir_xspec() {
23+
__bak_comp_compgen_filedir_xspec "$@"
24+
_pinyin_completion "$@"
25+
}
1826

27+
_pinyin_completion() {
1928
local cur="${COMP_WORDS[COMP_CWORD]}"
2029

2130
# ignore empty

0 commit comments

Comments
 (0)