Skip to content

"Unknown option 1" #1402

@mamaraddio

Description

@mamaraddio

Description

I got following warning during launch of the neovim:

[NvimTree] unknown option: 1

Any idea why thats happening?

Neovim version

NVIM v0.7.0

Operating system and version

ArchLinux fully upgraded

nvim-tree version

Latest

Minimal config

Default config from readme file + autocomand to auto close from  [#1115](https://github.com/kyazdani42/nvim-tree.lua/discussions/1115)

Steps to reproduce

Happens on startup

Expected behavior

No warnings

Actual behavior

Warning about unknown option 1

Activity

kyazdani42

kyazdani42 commented on Jul 7, 2022

@kyazdani42
Member

I think there is something wrong about how you set the setup table.
Aren't you doing something like setup( { { ... } }) instead of setup({ ... }) ?

mamaraddio

mamaraddio commented on Jul 7, 2022

@mamaraddio
Author

This is the content of my nvim-tree config file:

local status_ok, nvim_tree = pcall(require, "nvim-tree")
if not status_ok then
  return
end


nvim_tree.setup({
  vim.api.nvim_create_autocmd("BufEnter", {
    nested = true,
    callback = function()
      if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then
        vim.cmd "quit"
      end
    end
  })
)

And every time I open NeoVim, appers this:
image

Nvim-tree continue working as expected and the "auto_close" workaround works like a charm.

kyazdani42

kyazdani42 commented on Jul 7, 2022

@kyazdani42
Member

sure, the vim.api.nvim_create_autocmd is not supposed to be passed in setup

kyazdani42

kyazdani42 commented on Jul 7, 2022

@kyazdani42
Member

closing since this is an error with the config.

kyazdani42

kyazdani42 commented on Jul 7, 2022

@kyazdani42
Member

PS:

nvim_tree.setup({})
vim.api.nvim_create_autocmd...
mamaraddio

mamaraddio commented on Jul 7, 2022

@mamaraddio
Author

PS:

nvim_tree.setup({})
vim.api.nvim_create_autocmd...

Thanks, it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kyazdani42@mamaraddio

        Issue actions

          "Unknown option 1" · Issue #1402 · nvim-tree/nvim-tree.lua