Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nvim-tree very slow to open #1998

Closed
Raagh opened this issue Feb 14, 2023 · 10 comments
Closed

Nvim-tree very slow to open #1998

Raagh opened this issue Feb 14, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@Raagh
Copy link

Raagh commented Feb 14, 2023

Description

When opening nvim-tree from a buffer it takes forever to load and forever to go back to the buffer (seems to happen on big projects only)

Locking the plugin to this commit solves the issue
f3b7372

api-2023-02-14-09-18-17

Neovim version

NVIM v0.8.2

Operating system and version

Windows 11 (WSL Ubuntu)

nvim-tree version

latest

Minimal config

-- each of these are documented in `:help nvim-tree.OPTION_NAME`
local status_ok, nvim_tree = pcall(require, "nvim-tree")
if not status_ok then
  return
end

local config_status_ok, _ = pcall(require, "nvim-tree.config")
if not config_status_ok then
  return
end

nvim_tree.setup {
  disable_netrw = true,
  hijack_netrw = true,
  update_cwd = true,
  update_focused_file = {
    enable = true,
    update_cwd = true,
    ignore_list = {}
  },
  trash = {
    cmd = "trash",
    require_confirm = true,
  },
  actions = {
    open_file = {
      resize_window = false,
    }
  },
  view = {
    adaptive_size = true
  }
}

Steps to reproduce

  1. open nvim on a big project
  2. open a file
  3. open nvim-tree from the buffer

Expected behavior

works fast as before

Actual behavior

extremely slow to open and go back to buffer

@Raagh Raagh added the bug Something isn't working label Feb 14, 2023
@Raagh Raagh changed the title Nvim-tree slows down on open Nvim-tree extremely slow to open Feb 14, 2023
@Raagh Raagh changed the title Nvim-tree extremely slow to open Nvim-tree very slow to open Feb 14, 2023
@Bacbia3696
Copy link

Bacbia3696 commented Feb 14, 2023

yes, I have the same problem with nvim-tree, seem like the commit 4222bb8 cause the issue. The workaround is use previous commit.
For lazy nvim, you would need to go to: ~/.local/share/nvim/lazy/nvim-tree.lua, and checkout 8b8d457

@silvercircle
Copy link

Same here (on Linux). High CPU load and massive memory leaks when navigating directories. Definitely caused by 4222bb8. Everything before works normally.

@sungvadan
Copy link

Same problem (on mac).

@asher-gh
Copy link

asher-gh commented Feb 14, 2023

same here on mac. memory usage upto 30GB

@jhonrocha
Copy link

Same here. On Linux.
Here is my config:

	{
		"kyazdani42/nvim-tree.lua",
		lazy = false,
		dependencies = { "kyazdani42/nvim-web-devicons", lazy = false },
		opts = {
			actions = { open_file = { quit_on_open = true } },
			update_focused_file = { enable = true },
			renderer = { highlight_opened_files = "icon" },
			-- git = { enable = false },
			log = {
				enable = true,
				truncate = true,
				types = {
					diagnostics = true,
					git = true,
					profile = true,
					watcher = true,
				},
			},
		},
		keys = {
			{ "<leader>d", "<Cmd>NvimTreeFindFileToggle<CR>", desc = "file drawer" },
		},
	},

Here is nvim-tree.log: https://pastebin.pl/view/41c33e51

@jhonrocha
Copy link

jhonrocha commented Feb 14, 2023

@Bacbia3696 Setting commit = "8b8d457" on lazy.nvim does the rollback and fixes it:

	{
		"nvim-tree/nvim-tree.lua",
		commit = "8b8d457",
		dependencies = { "kyazdani42/nvim-web-devicons" },
		opts = {
			actions = { open_file = { quit_on_open = true } },
			update_focused_file = { enable = true },
			renderer = { highlight_opened_files = "icon" },
		},
		keys = {
			{ "<leader>d", "<Cmd>NvimTreeFindFileToggle<CR>", desc = "file drawer" },
		},
	},

@top4ek
Copy link

top4ek commented Feb 14, 2023

The same. Linux.
Rolling back to nightly "fixes" problem.

tree.setup {
  sync_root_with_cwd = true,
  respect_buf_cwd = true,
  update_focused_file = {
    enable = true,
    update_root = true
  },
  filters = {
	  dotfiles = false
  },
  renderer = {
	  group_empty = true
  },
  git = {
	  ignore = false
  },
  auto_reload_on_write = true,
  create_in_closed_folder = false,
  disable_netrw = true,
  hijack_unnamed_buffer_when_opening = true,
  view = {
    width = 30,
    -- height = 30,
    hide_root_folder = false,
    side = "left",
    preserve_window_proportions = false,
    number = true,
    relativenumber = true,
    signcolumn = "yes"
  }
}

@sungvadan
Copy link

@Bacbia3696 Setting commit = "8b8d457" on lazy.nvim does the rollback and fixes it:

	{
		"nvim-tree/nvim-tree.lua",
		commit = "8b8d457",
		dependencies = { "kyazdani42/nvim-web-devicons" },
		opts = {
			actions = { open_file = { quit_on_open = true } },
			update_focused_file = { enable = true },
			renderer = { highlight_opened_files = "icon" },
		},
		keys = {
			{ "<leader>d", "<Cmd>NvimTreeFindFileToggle<CR>", desc = "file drawer" },
		},
	},

It works. Thanks a lot

andersonfernandes added a commit to andersonfernandes/dotfiles that referenced this issue Feb 14, 2023
Related to the issue nvim-tree/nvim-tree.lua#1998

Signed-off-by: Anderson Fernandes <fernandesanderson14@gmail.com>
fbontin added a commit to fbontin/dotfiles that referenced this issue Feb 14, 2023
AniAggarwal referenced this issue Feb 14, 2023
* #1961 diagnostic logging refresh_nodes_for_path

* #1961 add cycle detection to refresh_nodes_for_path

* #1961 escape special characters on when path matching during refresh

* #1961 escape special characters on when path matching during refresh
@przepompownia
Copy link
Contributor

For me:

  • endless loading started to occur on 4222bb8
  • no such problem on 8b8d457

@alex-courtis
Copy link
Member

Change reverted, please accept my apologies.

fbontin added a commit to fbontin/dotfiles that referenced this issue Mar 30, 2023
jsappl added a commit to jsappl/nvim that referenced this issue Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants