fzf-tab icon indicating copy to clipboard operation
fzf-tab copied to clipboard

[BUG] Brace completion picks wrong candidates

Open tastytea opened this issue 3 years ago • 1 comments

Describe the bug

When the _approximate completer is used, the brace completion works the first time, but all other times it always picks the first candidate, regardless of what I select.

It works when the completion candidates are in the same directory, but not when they are in a subdirectory. It works without fzf-tab and with zstyle ':completion:*' menu select.

I can make sure:

  • [x] I am using the latest version of fzf-tab
  • [x] this is the minimal zshrc which can reproduce this bug
  • [x] fzf-tab is loaded after compinit
  • [x] fzf-tab is loaded after plugins which will wrap Tab, like junegunn/fzf/completion.zsh
  • [x] fzf-tab is loaded before zsh-autosuggestions, zsh-syntax-highlighting and fast-syntax-highlighting.

To Reproduce

Steps to reproduce the behavior:

  1. mkdir foo
  2. touch foo/{a,b,c}
  3. Try to get foo/{a,b,c} with completion

Expected behavior

I get what I select.

Screenshots

https://user-images.githubusercontent.com/3681516/166121481-e4ffc966-c6cd-4996-9090-df6bdc5b9daa.mp4

Environment:

  • OS: Gentoo Linux
  • zsh version: 5.8.1

Minimal zshrc

% zsh -df
% autoload -Uz compinit && compinit
% zstyle ':completion:*' completer _complete _approximate
% source /usr/share/zsh/site-functions/fzf-tab.zsh
% mkdir foo
% touch foo/{a,b,c}
% ls foo/{a,a,a,
% zstyle ':completion:*' completer _complete
% ls foo/{a,b,c,

Log

This is a log from my normal environment, fzf-tab would not show up with C-x . in the test environment. zsh-6605-fzf-tab-1.log

tastytea avatar Apr 30 '22 20:04 tastytea

Well, _approximate is not supported now: https://github.com/Aloxaf/fzf-tab/issues/56

Aloxaf avatar May 01 '22 03:05 Aloxaf