-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix issue where error is shown in fzf v0.56.1 or later #251
Conversation
src/core/parser.zsh
Outdated
local arguments=("${(Q)${(z)@}[@]}") | ||
local cmd=$(__fzf_extract_command "$@") | ||
|
||
if [[ "$(which __fzf_extract_command)" == *compstate* ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the result of fzf --version
but $(which __fzf_extract_command) is used because there may be who are fetching only
completion.zsh` such as me. https://github.com/hexium310/dotfiles/blob/6b61cdf90e49bb08824dcd779370436189cf010e/config/zsh/.zshrc#L23
Thanks for your effort on your investigation and modification so as to keep up with the latest version of fzf. How about checking the existence of the |
Can we use parameter expansion there for simplicity? |
As I briefly tested this PR, I don’t think this is enough to support the commit you mentioned (junegunn/fzf@57c08d9). Let’s think of this example: $ git checkout master; git fetch **<TAB> |
The completion of the second and subsequent executions may not be supported on the master branch either. git checkout master
# v0.56.0 doesn't have the change of __fzf_extract_command
source <(curl -L https://github.com/junegunn/fzf/raw/refs/tags/v0.56.0/shell/completion.zsh) fzf-zsh-completions.plugin.zsh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let’s merge this now and add support for the new completion available since fzf v0.56.1 later on.
After fzf v0.56.1, in all situations, shown completions are paths, and the following error is displayed.
_fzf_extract_command
has been rewritten and is no longer directly called, which is the cause of this issue. This PR replaces it with the global$cmd_word
according to the change of fzf.ref: junegunn/fzf@57c08d9