mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
## Description In certain filesystems — such as bind mounts, NFS, FUSE, or other mounted paths — uv.fs_scandir_next() may return a nil type for valid directories. This causes the snacks.nvim explorer to treat mounted folders as files, making them unexpandable in the UI. This patch adds a fallback to resolve the correct type when fs_scandir_next() returns nil. It uses uv.fs_stat() first, and falls back to vim.fn.isdirectory() if needed. This ensures that mounted directories are properly marked as navigable. Code change summary: - Inside Tree:expand, we now check t == nil - If so, we call uv.fs_stat() to get the true type - If fs_stat fails, we fallback to vim.fn.isdirectory - Final dir = true logic remains intact Impact: - Fixes a long-standing bug in mounted directories under /mnt, FUSE, etc. - Only runs extra checks when needed (no performance hit for regular files) - No changes elsewhere — clean, isolated patch ## Related Issue(s) - Fixes #2036 ## Screenshots before: <img width="1907" height="946" alt="image" src="https://github.com/user-attachments/assets/15e1b8a5-c999-49e8-8ab5-1d23c60e4969" /> after: <img width="343" height="902" alt="Screenshot_20250715_222920" src="https://github.com/user-attachments/assets/c7ca2fa0-e0cc-4e3d-a4bb-5345538408f7" /> --------- Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com> |
||
|---|---|---|
| .. | ||
| snacks | ||
| trouble/sources | ||