neo-tree.nvim icon indicating copy to clipboard operation
neo-tree.nvim copied to clipboard

BUG: Crash when filtering

Open hilpara opened this issue 1 year ago • 3 comments

Did you check docs and existing issues?

  • [X] I have read all the docs.
  • [X] I have searched the existing issues.
  • [X] I have searched the existing discussions.

Neovim Version (nvim -v)

NVIM v0.9.1

Operating System / Version

MacOs 13.4.1

Describe the Bug

The neo-tree crashes when trying to search files. Afterwards it is required to restart the Neovim to be able to use the neo-tree again.

Screenshots, Traceback

E5108: Error executing lua: ...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:1076: Key not found: neo_tree_position stack traceback: [C]: in function 'nvim_buf_get_var' ...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:1076: in function 'window_exists' ...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:120: in function 'close' ...re/nvim/lazy/neo-tree.nvim/lua/neo-tree/command/init.lua:85: in function 'execute' ...l/share/nvim/lazy/LazyVim/lua/lazyvim/plugins/editor.lua:21: in function <...l/share/nvim/lazy/LazyVim/lua/lazyvim/plugins/editor.lua:20>

[Neo-tree ERROR] Error in event handler for event vim_buffer_modified_set[filesystem.vim_buffer_modified_set]: ...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:1076: Key not found: neo_tree_position

With repro.lua: Error executing vim.schedule lua callback: ...xxx/Temp/.repro/plugins/plenary.nvim/lua/plenary/job.lua:404: Failed to spawn process: { _additional_on_exit_callbacks = {}, _shutdown_check = <userdata 1>, _stderr_results = {}, _stdout_results = {}, _user_on_exit = <function 1>, _user_on_start = <function 2>, args = { "-C", "/Users/xxxxx/STM32Cube/Repository/STM32Cube_FW_H7_V1.10.0/Middlewares/Third_Party/FatFs/doc", "check-ignore", "--stdin" }, command = "git", enable_handlers = true, enable_recording = true, interactive = true, pid = "EMFILE: too many open files", stderr = <userdata 2>, stdin = <userdata 3>, stdout = <userdata 4>, user_data = {}, writer = { "/Users/xxxxx/STM32Cube/Repository/STM32Cube_FW_H7_V1.10.0/Middlewares/Third_Party/FatFs/doc/res" }, = <1>{ __index = <table 1>, _create_uv_options = <function 3>, _execute = <function 4>, _pipes_are_closed = <function 5>, _prepare_pipes = <function 6>, _reset = <function 7>, _shutdown = <function 8>, _stop = <function 9>, add_on_exit_callback = <function 10>, after = <function 11>, after_failure = <function 12>, after_success = <function 13>, and_then = <function 14>, and_then_on_failure = <function 15>, and_then_on_failure_wrap = <function 16>, and_then_on_success = <function 17>, and_then_on_success_wrap = <function 18>, and_then_wrap = <function 19>, chain = <function 20>, chain_status = <function 21>, co_wait = <function 22>, is_job = <function 23>, join = <function 24>, new = <function 25>, pid = <function 26>, result = <function 27>, _prepare_pipes = <function 6>, _reset = <function 7>, _shutdown = <function 8>, _stop = <function 9>, add_on_exit_callback = <function 10>, after = <function 11>, after_failure = <function 12>, after_success = <function 13>, and_then = <function 14>, and_then_on_failure = <function 15>, and_then_on_failure_wrap = <function 16>, and_then_on_success = <function 17>, and_then_on_success_wrap = <function 18>, and_then_wrap = <function 19>, chain = <function 20>, chain_status = <function 21>, co_wait = <function 22>, is_job = <function 23>, join = <function 24>, new = <function 25>, pid = <function 26>, result = <function 27>, send = <function 28>, shutdown = <function 29>, start = <function 30>, stderr_result = <function 31>, sync = <function 32>, wait = <function 33> } } stack traceback: ...nen/Temp/.repro/plugins/plenary.nvim/lua/plenary/job.lua:404: in function '_execute' ...nen/Temp/.repro/plugins/plenary.nvim/lua/plenary/job.lua:447: in function 'start' ...repro/plugins/neo-tree.nvim/lua/neo-tree/git/ignored.lua:138: in function 'mark_ignored' ...ree.nvim/lua/neo-tree/sources/filesystem/lib/fs_scan.lua:136: in function 'job_complete' ...ree.nvim/lua/neo-tree/sources/filesystem/lib/fs_scan.lua:413: in function '' vim/_editor.lua: in function <vim/_editor.lua:0> stack traceback: [C]: in function 'error' ...nen/Temp/.repro/plugins/plenary.nvim/lua/plenary/job.lua:404: in function '_execute' ...nen/Temp/.repro/plugins/plenary.nvim/lua/plenary/job.lua:447: in function 'start' ...repro/plugins/neo-tree.nvim/lua/neo-tree/git/ignored.lua:138: in function 'mark_ignored' ...ree.nvim/lua/neo-tree/sources/filesystem/lib/fs_scan.lua:136: in function 'job_complete' ...ree.nvim/lua/neo-tree/sources/filesystem/lib/fs_scan.lua:413: in function '' vim/_editor.lua: in function <vim/_editor.lua:0>

Steps to Reproduce

  1. Vanilla LazyVim
  2. Start nvim in ~/.config/nvim
  3. 2 * to home folder
  4. Filter /.xml (or it doesn't really matter. Sometimes works, most of the time crashes)

Expected Behavior

Should show only the filtered files and not crash

Your Configuration

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  -- add any other plugins here
}

local neotree_config = {
  "nvim-neo-tree/neo-tree.nvim",
  dependencies = { "MunifTanjim/nui.nvim", "nvim-tree/nvim-web-devicons", "nvim-lua/plenary.nvim" },
  cmd = { "Neotree" },
  keys = {
    { "<Leader>e", "<Cmd>Neotree<CR>" }, -- change or remove this line if relevant.
  },
  opts = {
    -- Your config here
    -- ...
  },
}

table.insert(plugins, neotree_config)
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

hilpara avatar Jul 31 '23 13:07 hilpara

Using the provided reproduction configuration, I am not able to recreate this issue image

Tested both on nvim 0.9.1 (stable) and a nightly nvim 0.10 on linux and windows. Can you try with a fresh install of nvim 0.9.1 and run without LazyVim? The command would simply be

$ nvim --clean -u YOUR_REPRODUCTION_CONFIG.lua

This may be an issue with mac but I am unsure and I don't have a mac (or macos vm) that I can test on unfortunately

miversen33 avatar Jul 31 '23 17:07 miversen33

Potentially (likely) related to #1046

miversen33 avatar Jul 31 '23 18:07 miversen33