Skip to content

"E684: list index out of range: 0" when <C-c> in fzf #5

Open
@zenazn

Description

@zenazn

If you <C-]> / <Plug>(fzf_tags) on a tag with multiple options, then <C-c> without selecting an option in FZF, vim will barf with the following error message:

Error detected while processing function fzf_tags#FindCommand[1]..fzf_tags#Find[12]..fzf#run[69]..<SNR>24_callback:
line   21:
Vim(let):E684: list index out of range: 0
Error detected while processing function fzf_tags#FindCommand[1]..fzf_tags#Find:
line   12:
E171: Missing :endif

I instead expect FZF / fzf-tags to exit without an error and without jumping me anywhere.

I'm pretty bad at vimscript, but adding the following to the top of s:sink seems to fix the problem:

  if len(a:selection) == 0
    return
  end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions