-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
bleh.sh #431
Comments
Currently, the default completions are always started when there are no completions. I'll later add a If there are any other requests or questions on the detailed behavior of |
Thanks, I've been meaning to ask about that. ❯ example action --optarg=<TAB> |
Thank you for the report! How can I reproduce it?
# git repository for carapace (HEAD = c79a097)
carapace_path=~/.mwg/git/rsteube/carapace
# git repository for carapace (HEAD = 775bab9a) compiled with "docker-compose run build"
carapace_bin_path=~/.mwg/git/rsteube/carapace-bin
PATH=$carapace_bin_path/cmd/carapace:$PATH
source ~/.mwg/src/ble.sh/out/ble.sh --norc
eval "$(carapace _carapace bash-ble)"
source "$carapace_path/example/cmd/_test/bash-ble.sh"
ble/bin#has example || ln -s carapace "$carapace_bin_path/cmd/carapace/example" I have fixed diff --git a/example/cmd/_test/bash-ble.sh b/example/cmd/_test/bash-ble.sh
index 62c1509..013bb7c 100644
--- a/example/cmd/_test/bash-ble.sh
+++ b/example/cmd/_test/bash-ble.sh
@@ -24,7 +24,7 @@ _example_completion_ble() {
local compline="${COMP_LINE:0:${COMP_POINT}}"
local IFS=$'\n'
local c
- mapfile -t c < <(echo "$compline" | sed -e "s/ \$/ ''/" -e 's/"/\"/g' | xargs example _carapace bash-ble)
+ mapfile -t c < <(echo "$compline" | sed -e "s/ \$/ ''/" -e 's/"/\"/g' | xargs example example bash-ble)
[[ "${c[*]}" == "" ]] && c=() # fix for mapfile creating a non-empty array from empty command output
local cand Edit: Ah, OK. I now noticed that For now, I gave up trying to check the behavior for |
Will have a look at this later. It was just a quick assumption, i haven't analysed this in detail yet. |
Thank you for the comment! If I could reproduce it, I'll also investigate it.
The internal completion generation does not use |
OK, there are two reasons that prevent the optarg completion from working properly.
diff --git a/example/cmd/_test/bash-ble.sh b/example/cmd/_test/bash-ble.sh
index 62c1509..84aa22b 100644
--- a/example/cmd/_test/bash-ble.sh
+++ b/example/cmd/_test/bash-ble.sh
@@ -29,7 +29,7 @@ _example_completion_ble() {
local cand
for cand in "${c[@]}"; do
- [ ! -z "$cand" ] && ble/complete/cand/yield mandb "${cand%$'\t'*}" "${cand##*$'\t'}"
+ [ ! -z "$cand" ] && ble/complete/cand/yield mandb "$progcomp_prefix${cand%$'\t'*}" "${cand##*$'\t'}"
done
else
complete -F _example_completion example
diff --git a/internal/bash_ble/snippet.go b/internal/bash_ble/snippet.go
index 244936c..902bc5a 100644
--- a/internal/bash_ble/snippet.go
+++ b/internal/bash_ble/snippet.go
@@ -30,7 +30,7 @@ _%v_completion_ble() {
local cand
for cand in "${c[@]}"; do
- [ ! -z "$cand" ] && ble/complete/cand/yield mandb "${cand%%$'\t'*}" "${cand##*$'\t'}"
+ [ ! -z "$cand" ] && ble/complete/cand/yield mandb "$progcomp_prefix${cand%%$'\t'*}" "${cand##*$'\t'}"
done
else
complete -F _%v_completion %v |
Ah, OK. I see. Then the only problem must be the first one. Thank you for pointing it out. |
Sorry for the delay.
For this problem, I have finally decided not to generate the RHS-completion context, so that only the argument completion (and thus progcomp completion) is activated. I have now pushed the fix in
For this one, I have newly added a compopt -o ble/no-default |
https://github.com/akinomyoga/ble.sh
related carapace-sh/carapace-bin#938
The text was updated successfully, but these errors were encountered: