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

[BUG] Completing multiple selections inbetween tokens inserts spaces wrongly

Open oddlama opened this issue 2 years ago • 2 comments

Description & Steps to Reproduce

I sometimes try to insert new options before existing tokens such as files that i already wrote:

any_command --somearg --<Tab> FILE1 FILE2

If you select a single entry in this szenario, everything is fine and the result is

any_command --somearg --yourselection FILE1 FILE2

But as soon as you select multiple entries, the result messes up the spacing like this:

any_command --somearg  --selection1 --selection2FILE1 FILE2

Expected behavior

When using multiple selections a space should always be appended after each selected argument, but it seems like a space is prepended for some reason.

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.

Environment:

  • OS: nixos unstable
  • zsh version: 5.9

Minimal zshrc

An otherwise empty zshrc with just compinit and the fzf plugin already shows this behavior.

oddlama avatar Feb 16 '23 13:02 oddlama

This seems to be a bug of upstream.

Pretend code

zle -C all-matches complete-word _generic
bindkey '^Xa' all-matches
zstyle ':completion:all-matches:*' old-matches only
zstyle ':completion:all-matches::::' completer _all_matches
disable-fzf-tab
mkdir a b c

: <Press tab and then C-x a> 0123456 and result is : a b0 c1 d/23456

Aloxaf avatar Feb 17 '23 09:02 Aloxaf

It there any way to see if this issue is known upstream? I cannot find a search function in their mailing list archive :/

oddlama avatar Feb 17 '23 14:02 oddlama