Skip to content

Nvim-Tree: Attempt to perform arithmetic on a nil value #2868

Closed
@undefinedcode0

Description

@undefinedcode0

Description

Issues with the Nvim-Tree Lua spitting out an error when pressing 'Ctrl+N"

"Error executing Lua callback: ...r\start\nvim-tree.lua/lua/nvim-tree/explorer/explore.lua:63: attempt to perform arithme tic on a nil value stack traceback: ...r\start\nvim-tree.lua/lua/nvim-tree/explorer/explore.lua:63: in function 'populate_children' ...r\start\nvim-tree.lua/lua/nvim-tree/explorer/explore.lua:85: in function 'explore' ...cker\start\nvim-tree.lua/lua/nvim-tree/explorer/init.lua:62: in function '_load' ...cker\start\nvim-tree.lua/lua/nvim-tree/explorer/init.lua:53: in function 'new' ...e\pack\packer\start\nvim-tree.lua/lua/nvim-tree/core.lua:19: in function 'init' ...te\pack\packer\start\nvim-tree.lua/lua/nvim-tree/lib.lua:261: in function 'open' ...\start\nvim-tree.lua/lua/nvim-tree/actions/tree/open.lua:32: in function 'open' ...ck\packer\start\nvim-tree.lua/lua/nvim-tree/commands.lua:15: in function <...ck\packer\start\nvim-tree.lua/lu a/nvim-tree/commands.lua:14>"

Neovim version

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1713484068

Operating system and version

Windows 10, Build 19044.4780 IoT LTSC

Windows variant

Nushell, CMD

nvim-tree version

ad0b95d

Clean room replication

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "nvim-tree/nvim-tree.lua",
      "nvim-tree/nvim-web-devicons",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {}
end

-- UNCOMMENT this block for diagnostics issues, substituting pattern and cmd as appropriate.
-- Requires diagnostics.enable = true in setup.
--[[
vim.api.nvim_create_autocmd("FileType", {
  pattern = "lua",
  callback = function()
    vim.lsp.start { cmd = { "lua-language-server" } }
  end,
})
]]

Steps to reproduce

  • Open neovim via a CMD and run nvim.
  • Press CTRL + N

Expected behavior

A file tree in the sidebar is expected from the neovim session.

Actual behavior

Upon pressing CTRL + N, the terminal logs this error inside of the neovim session:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS Windowsspecific to windowsbugSomething isn't workingduplicateTracked via another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions