Skip to content

fix: override more functions to support more commands #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/bash_pinyin_completion
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ fi

eval "function __bak_comp_compgen_filedir() { $(declare -f _comp_compgen_filedir | tail -n +2) }"
eval "function __bak_comp_compgen_filedir_xspec() { $(declare -f _comp_compgen_filedir_xspec | tail -n +2) }"
eval "function __bak_comp_complete_minimal() { $(declare -f _comp_complete_minimal | tail -n +2) }"
eval "function __bak_comp_expand_glob() { $(declare -f _comp_expand_glob | tail -n +2) }"

# replace _comp_compgen_filedir
_comp_compgen_filedir() {
Expand All @@ -24,6 +26,16 @@ _comp_compgen_filedir_xspec() {
_pinyin_completion "$@"
}

_comp_complete_minimal() {
__bak_comp_complete_minimal "$@"
_pinyin_completion "$@"
}

_comp_expand_glob() {
__bak_comp_expand_glob "$@"
_pinyin_completion "$@"
}

_pinyin_completion() {
local cur="${COMP_WORDS[COMP_CWORD]}"

Expand Down