-
Notifications
You must be signed in to change notification settings - Fork 101
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
Add support of _approximate completer #57
base: master
Are you sure you want to change the base?
Conversation
`-U` flag causes bug when compleing parameter. But remove it will let _approximate won't work.
I don't know why the result of |
You can now use _approximate, but there is no fzf support. And a better stability.
I just tried to merge this on top of master. After resolving two obvious conflicts, this almost works, except tht if the _approximate completer is invoked, the captured prefix inserted into fzf contains a spurious I guess this is related to the games _approximate plays with compadd itself: if (( ! $+functions[compadd] ))
then
dounfunction=1
compadd () {
local ppre="$argv[(I)-p]"
[[ ${argv[(I)-[a-zA-Z]#U[a-zA-Z]#]} -eq 0 && "${#:-$PREFIX$SUFFIX}" -le _comp_correct ]] && return
if [[ "$PREFIX" = \~* && ( ppre -eq 0 || "$argv[ppre+1]" != \~* ) ]]
then
PREFIX="~(#a${_comp_correct})${PREFIX[2,-1]}"
else
PREFIX="(#a${_comp_correct})$PREFIX"
fi
(( $_correct_group && ${${argv[1,(r)-(|-)]}[(I)-*[JV]]} )) && _correct_expl[_correct_group]=${argv[1,(r)-(-|)][(R)-*[JV]]}
builtin compadd "$_correct_expl[@]" "$@"
}
fi Any ideas or pointers to start chasing? |
I added a dirtiest hack in intelfx@7f1d458 and _approximate seems to work reasonably with fzf-tab now. The only thing left is to maybe preselect the |
Fix #56