junegunn / junegunn/fzf.vim

E728 in fzf#vim#colors() when first arg is a dictionary

Open
#1,610 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
10.3k
Forks
608
Avg merge
5d 8h
Merged PRs (30d)
2

Description

## Bug

`fzf#vim#colors()` throws `E728: Using a Dictionary as a Number` on line 614 of `autoload/fzf/vim.vim` when called with a spec dict as the first argument.

## Cause

```vim
if !a:1 " We can't set up IPC in fullscreen mode in Vim
```

This assumes `a:1` is always a number (`0` from the `:Colors` command), but the function's public API accepts `([spec dict], [fullscreen bool])` — so `a:1` can be a dictionary.

## Steps to reproduce

```vim
:call fzf#vim#colors({})
```

## Suggested fix

```vim
if a:0 && type(a:1) != s:TYPE.dict && !a:1
```

This matches how `s:fzf()` (line 322) already handles the same varargs pattern.

## Version

Latest master (`34a564c81f`)

Introduced in `04bfa81157` ([Colors] Change color scheme on the fly (experimental)).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.