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 freezes when i disable git files #2938

Closed
AlejandroSanchez90 opened this issue Oct 4, 2024 · 4 comments · Fixed by #2940
Closed

Nvim freezes when i disable git files #2938

AlejandroSanchez90 opened this issue Oct 4, 2024 · 4 comments · Fixed by #2940
Labels
performance performance enhancement

Comments

@AlejandroSanchez90
Copy link

Description

im working on a monorepo app, if i set use this config

			git = {
				enable = false,
			},

then each time i open nvim tree and open a file or folder using nvim tree, then after i quit it will hang for around 20 to 30 secs, opening the file with a picker like fzflua or telescope does work fine, so in the meantime i enabled git to be able to quit, but i do need to see my env files and some other ignored files whiile working

Neovim version

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1724232689

Operating system and version

MacOs Sonoma 14.6.1

Windows variant

No response

nvim-tree version

latest

Clean room replication

return {
	"nvim-tree/nvim-tree.lua",
	dependencies = "nvim-tree/nvim-web-devicons",
	config = function()
		local nvimtree = require("nvim-tree")

		-- recommended settings from nvim-tree documentation
		vim.g.loaded_netrw = 1
		vim.g.loaded_netrwPlugin = 1

		nvimtree.setup({
			view = {},
			-- change folder arrow icons
			renderer = {
				indent_markers = {
					enable = true,
				},
				icons = {
					glyphs = {
						folder = {
							-- arrow_closed = "", -- arrow when folder is closed
							-- arrow_open = "", -- arrow when folder is open
						},
					},
				},
			},
			-- disable window_picker for
			-- explorer to work well with
			-- window splits
			actions = {
				open_file = {
					window_picker = {
						enable = false,
					},
				},
			},
			filters = {
				custom = { ".DS_Store" },
			},
			git = {
				enable = false,
			},
		})

		-- set keymaps
		local keymap = vim.keymap -- for conciseness

		keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" }) -- toggle file explorer
		keymap.set("n", "<leader>ef", "<cmd>NvimTreeFindFile<CR>", { desc = "Toggle file explorer on current file" }) -- toggle file explorer on current file
		keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>", { desc = "Collapse file explorer" }) -- collapse file explorer
		keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "Refresh file explorer" }) -- refresh file explorer
		keymap.set("n", "<leader>el", "<cmd>NvimTreeResize +20<CR>", { desc = "Increase size" }) -- refresh file explorer
		keymap.set("n", "<leader>eh", "<cmd>NvimTreeResize -20<CR>", { desc = "Decrease size" }) -- refresh file explorer
	end,
}

Steps to reproduce

all i do is enter nvim, open nvim-tree, open a folder or file, ex package.json, then :q, and neovim hangs in there for 1~ min

Expected behavior

No response

Actual behavior

No response

@AlejandroSanchez90 AlejandroSanchez90 added the bug Something isn't working label Oct 4, 2024
@alex-courtis
Copy link
Member

Hypothesis: when git is enabled, .gitignore is read and those files are not enumerated. When disabled, all files such as node_modules or target are enumerated.

Please provide diagnostic/performance logs: https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting#diagnostic-logging

I imagine these might be private so you may want to sanitize them before posting.

Alternatively, try reproducing via the massive react facebook example react app: #1931

@alex-courtis alex-courtis added awaiting feedback performance performance enhancement and removed bug Something isn't working labels Oct 5, 2024
@AlejandroSanchez90
Copy link
Author

AlejandroSanchez90 commented Oct 5, 2024 via email

@alex-courtis
Copy link
Member

fzf ended up hard-coding them: junegunn/fzf#3649

I'm tempted to do the same. Which ignore list did you add them to?

@AlejandroSanchez90
Copy link
Author

fzf ended up hard-coding them: junegunn/fzf#3649

I'm tempted to do the same. Which ignore list did you add them to?

https://github.com/AlejandroSanchez90/dotfiles/blob/main/dot_config%2Fnvim%2Flua%2Falex%2Fplugins%2Fnvim-tree.lua#L43-L46

alex-courtis added a commit that referenced this issue Oct 5, 2024
alex-courtis added a commit that referenced this issue Oct 7, 2024
alex-courtis added a commit that referenced this issue Oct 7, 2024
alex-courtis added a commit that referenced this issue Oct 7, 2024
…cache", "/build", "/node_modules", "/target", } (#2940)

* feat(#2938): filesystem_watchers.ignore_dirs defaults to { node_modules } to resolve pathalogical issues

* feat(#2938): more filesystem_watchers.ignore_dirs defaults to to resolve pathalogical issues

* feat(#2938): more filesystem_watchers.ignore_dirs defaults to to resolve pathalogical issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance performance enhancement
Projects
None yet
2 participants