Skip to content

[BUG] completion is mess when _describe use alternative array #424

Open
@HIDE-r

Description

@HIDE-r

Describe the bug

A clear and concise description of what the bug is.

I can make sure:

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

To Reproduce

Steps to reproduce the behavior:

  1. Type 'cmd '
  2. Press Tab
  3. See error
Lenovo-R9000K% cat $HOME/test_zshrc
fpath=($HOME/.fpath $fpath)

autoload -U compinit; compinit
source ~/somewhere/fzf-tab.plugin.zsh
Lenovo-R9000K% cat $HOME/.fpath/_cmd
#compdef cmd

local -a subcmds topics
subcmds=('c:description for c command' 'd:description for d command')
# topics=('e:description for e help topic' 'f:description for f help topic')
topics=('c:description for c command' 'd:description for d command')
_describe 'command' subcmds topics
❯ git clone https://github.com/Aloxaf/fzf-tab ~/somewhere
❯ zsh -d -f
Lenovo-R9000K% source test_zshrc
Lenovo-R9000K% cmd c:description\ for\ c\ command 

asciicast

Expected behavior

There should be no extra characters('description\ for\ c\ command')

Screenshots

If applicable, add screenshots to help explain your problem.

Environment:

  • OS: Arch Linux
  • zsh version: 5.9 (x86_64-pc-linux-gnu)

Minimal zshrc

Lenovo-R9000K% cat $HOME/test_zshrc
fpath=($HOME/.fpath $fpath)

autoload -U compinit; compinit
source ~/somewhere/fzf-tab.plugin.zsh

Log

zsh-48936-fzf-tab-1.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions