Comments (26)
@overcache this was actually an easy fix for me
I digged into the source and found
local function is_folder_ignored(path) for _, folder in ipairs(IGNORED_PATHS) do if vim.startswith(path, folder) then return true end end for _, ignore_dir in ipairs(M.config.filesystem_watchers.ignore_dirs) do if vim.fn.match(path, ignore_dir) ~= -1 then return true end end return false endso all I had to add in my config was
filesystem_watchers = { enable = true, debounce_delay = 50, ignore_dirs = { "node_modules" }, },and now my nvim instantly closes without any delay
thanks, it works
from nvim-tree.lua.
That sounds reasonable.
Yes, we can add .gitignore
parsing and filtering, however it is a non-trivial task, with no off the shelf solution: #2367
I'll close this one as we can track it in there.
from nvim-tree.lua.
I can't replicate it (in sense that I have never experienced that before). Is the delay present without any open buffers as well?
from nvim-tree.lua.
I can't replicate it (in sense that I have never experienced that before). Is the delay present without any open buffers as well?
when I delete all buffer manually before exit, the issuse still present.
Did you use the 'webpack' project? When I open files in node_modules, the issuse occur. Open other files which not in node_modules, thats fine.
from nvim-tree.lua.
iShot_2023-10-01_19.54.12.mp4
from nvim-tree.lua.
Tried unsuccessfully with minimal config and linux source:
:e COPYING
:NvimTreeFindFile
:e tools/testing/selftests/rcutorture/formal/srcu-cbmc/include/linux/types.h
Your video shows that you are using plugins other than specified in the minimal config. Please reproduce with the minimal config as instructed: "Clean Room" Replication
Please enable Diagnostic Logging after reproducing with git
profile
and watcher
.
from nvim-tree.lua.
There is no other plugins, the top line of video was the tmux panel list.
I tried to reproduce on a fresh linux virtual machine this morning but failed. It seems that I can only replay the issue on my iMac.
After delete some nvim-tree setting, the necessary settting are:
require("nvim-tree").setup {
update_focused_file = {
enable = true,
},
git = { ignore = false },
}
Either set update_focused_file.enable = false
or git.ignore = true
get rid of the "hang on :qa" problem.
I can't find out what environment effect nvim-tree works, any advice?
Here is another video:
iShot_2023-10-02_12.22.42.mp4
from nvim-tree.lua.
Is the iMac old / slow? Was the VM on that iMac?
It seems the issue could be:
- slow git processing (unlikely, as it's mostly async)
- slow FS enumeration
Diagnostic Logging will shed some light on this.
from nvim-tree.lua.
Unrelated, however you can get some significant OSX git performance gains Git fsmonitor Daemon
from nvim-tree.lua.
My computer is a 2017 iMac. It's a bit old, but not that old.
I just logged into the guest account and was able to reproduce the issue. I'll try it on my M1 MacBook at home tonight.
from nvim-tree.lua.
I can reproduce on M1 Macbook air(macOS 12.6.5 ) too.
from nvim-tree.lua.
Without logs or being able to reproduce there's no path forward here.
@gegoune could you attempt a replication?
from nvim-tree.lua.
I can reproduce this and neovim just hangs after I did a npm install
on the project
I think nvim-tree is trying to read updates in node_modules folder which causes the hang
from nvim-tree.lua.
@alex-courtis Didn't get a chance yet. node_modules
consist of thousands of files. Maybe adding it to gitignore will help? Since │nvim-tree.git.timeout
is lower by default than reported 5s I am not sure how it is related. Also, what is git.ignore
? Can't find it in docs nor code.
from nvim-tree.lua.
@alex-courtis Didn't get a chance yet.
node_modules
consist of thousands of files.
Maybe adding it to gitignore will help? Since
│nvim-tree.git.timeout
is lower by default than reported 5s I am not sure how it is related.
This looks like #1931 The combination of gitignore and the MacOS git fs monitor daemon worked in that case.
Also, what is
git.ignore
? Can't find it in docs nor code.
Ah... that one was silently migrated to filters.git_ignored
Raised #2468 as it may be unrelated.
from nvim-tree.lua.
We need logs (see above) to continue @overcache , @GZLiew
from nvim-tree.lua.
@alex-courtis ignoring node_modules
fixes the latency of closing nvim
but other editors didnt have this issue before
heres the logs and video
https://github.com/nvim-tree/nvim-tree.lua/assets/43195293/adc04760-677c-4d3d-8545-edd73ba0851a
{
actions = {
change_dir = {
enable = true,
global = false,
restrict_above_cwd = false
},
expand_all = {
exclude = {},
max_folder_discovery = 300
},
file_popup = {
open_win_config = {
border = "shadow",
col = 1,
relative = "cursor",
row = 1,
style = "minimal"
}
},
open_file = {
eject = true,
quit_on_open = true,
resize_window = true,
window_picker = {
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
enable = true,
exclude = {
buftype = { "nofile", "terminal", "help" },
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }
},
picker = "default"
}
},
remove_file = {
close_window = true
},
use_system_clipboard = true
},
auto_reload_on_write = true,
diagnostics = {
debounce_delay = 50,
enable = false,
icons = {
error = "",
hint = "",
info = "",
warning = ""
},
severity = {
max = 1,
min = 4
},
show_on_dirs = false,
show_on_open_dirs = true
},
disable_netrw = false,
experimental = {},
filesystem_watchers = {
debounce_delay = 50,
enable = true,
ignore_dirs = {}
},
filters = {
custom = {},
dotfiles = false,
exclude = {},
git_clean = false,
git_ignored = true,
no_buffer = false
},
git = {
disable_for_dirs = {},
enable = true,
show_on_dirs = true,
show_on_open_dirs = true,
timeout = 400
},
hijack_cursor = false,
hijack_directories = {
auto_open = true,
enable = true
},
hijack_netrw = true,
hijack_unnamed_buffer_when_opening = false,
live_filter = {
always_show_folders = true,
prefix = "[FILTER]: "
},
log = {
enable = true,
truncate = false,
types = {
all = true,
config = false,
copy_paste = false,
dev = false,
diagnostics = false,
git = false,
profile = false,
watcher = false
}
},
modified = {
enable = false,
show_on_dirs = true,
show_on_open_dirs = true
},
notify = {
absolute_path = true,
threshold = 2
},
on_attach = <function 1>,
prefer_startup_root = false,
reload_on_bufenter = false,
renderer = {
add_trailing = false,
full_name = false,
group_empty = false,
highlight_bookmarks = "none",
highlight_clipboard = "name",
highlight_diagnostics = false,
highlight_git = false,
highlight_modified = "none",
highlight_opened_files = "none",
icons = {
bookmarks_placement = "signcolumn",
diagnostics_placement = "signcolumn",
git_placement = "before",
glyphs = {
bookmark = "",
default = "",
folder = {
arrow_closed = "",
arrow_open = "",
default = "",
empty = "",
empty_open = "",
open = "",
symlink = "",
symlink_open = ""
},
git = {
deleted = "",
ignored = "◌",
renamed = "➜",
staged = "✓",
unmerged = "",
unstaged = "✗",
untracked = "★"
},
modified = "●",
symlink = ""
},
modified_placement = "after",
padding = " ",
show = {
bookmarks = true,
diagnostics = true,
file = true,
folder = true,
folder_arrow = true,
git = true,
modified = true
},
symlink_arrow = " ➛ ",
web_devicons = {
file = {
color = true,
enable = true
},
folder = {
color = true,
enable = false
}
}
},
indent_markers = {
enable = false,
icons = {
bottom = "─",
corner = "└",
edge = "│",
item = "│",
none = " "
},
inline_arrows = true
},
indent_width = 2,
root_folder_label = ":~:s?$?/..?",
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
symlink_destination = true
},
respect_buf_cwd = false,
root_dirs = {},
select_prompts = false,
sort = {
files_first = false,
folders_first = true,
sorter = "name"
},
sync_root_with_cwd = false,
system_open = {
args = {},
cmd = ""
},
tab = {
sync = {
close = false,
ignore = {},
open = false
}
},
trash = {
cmd = "trash"
},
ui = {
confirm = {
remove = true,
trash = true
}
},
update_focused_file = {
enable = true,
ignore_list = {},
update_root = false
},
view = {
centralize_selection = false,
cursorline = true,
debounce_delay = 15,
float = {
enable = false,
open_win_config = {
border = "rounded",
col = 1,
height = 30,
relative = "editor",
row = 1,
width = 30
},
quit_on_focus_loss = true
},
number = true,
preserve_window_proportions = false,
relativenumber = true,
side = "left",
signcolumn = "yes",
width = 200
}
}
from nvim-tree.lua.
We need logs (see above) to continue @overcache , @GZLiew
here it is:
nvim-tree.log
steps which genrate logs above:
- cd webpack
- nvim -nu ~/Downloads/nvt-min.lua
- :e package.json
- :NvimTreeFindFile
- :e node_modules/semver/bin/semver.js
- :qa
from nvim-tree.lua.
This is useful, thank you for digging.
It looks like it's simply the number of folders. Let's fix #2468 and see how it goes.
from nvim-tree.lua.
#2468 has been resolved.
@overcache Would you mind updating nvim-tree to check if issue still persists?
from nvim-tree.lua.
#2468 has been resolved.
@overcache Would you mind updating nvim-tree to check if issue still persists?
still persists with 05f55c1
from nvim-tree.lua.
I think your neovim is debug mode.
Please check.
from nvim-tree.lua.
I think your neovim is debug mode. Please check.
no, it's not.
❯ nvim --version
NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1700008891
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.4/share/nvim"
Run :checkhealth for more info
from nvim-tree.lua.
Hm... It is only for nvim-tree? I don't know it is nvim-tree's problem or not.
You can check where the routine causes the problem. It is OSS.
from nvim-tree.lua.
@overcache this was actually an easy fix for me
I digged into the source and found
local function is_folder_ignored(path)
for _, folder in ipairs(IGNORED_PATHS) do
if vim.startswith(path, folder) then
return true
end
end
for _, ignore_dir in ipairs(M.config.filesystem_watchers.ignore_dirs) do
if vim.fn.match(path, ignore_dir) ~= -1 then
return true
end
end
return false
end
so all I had to add in my config was
filesystem_watchers = {
enable = true,
debounce_delay = 50,
ignore_dirs = {
"node_modules"
},
},
and now my nvim instantly closes without any delay
from nvim-tree.lua.
@alex-courtis I guess this is a feature request whether we can add gitignore to config filesystem_watchers
instead of specifying all the directories as I still want to view the ignored files in nvim-tree but do not want them to be actively watched
from nvim-tree.lua.
Related Issues (20)
- If using floating mode and creating a new file the floating window becomes the created file. HOT 2
- Bookmark filter should include parent directory HOT 1
- Bad contrast for NvimTreeWindowPicker & NvimTreeBookmarkHL on default colorscheme HOT 7
- Mappings/functionality discoverability discussion HOT 10
- update_root won't update with respect_buf_cwd when open file HOT 3
- change_root_to_node() does not work on files HOT 1
- how to use one instance in different tab HOT 2
- Sticky nvim-tree and not using window_picker: How to remember the window where navigating into nvim-tree from?
- Quitting neovim takes a long time when toggling git ignore folders HOT 3
- Add winfixbuf to view options HOT 4
- Provide interface to customize the comparing function between two nodes HOT 1
- 0.10 luadoc and lsp integration
- Parent folder deleted when deleting a folder starting with $ HOT 4
- Make it easy to discover useful shortcuts HOT 2
- New File getting opened in floating window. HOT 5
- Module `nvim-tree.renderer.help` not found when install nvim-tree through Lazy HOT 1
- nvim-tree not respecting diagnostics update_in_insert value set by neovim HOT 8
- Float window for full filenames has wrong bg HOT 2
- Floating nvim-tree does not respect config on startup HOT 2
- Right aligned icons HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-tree.lua.