Commit graph

17 commits

Author SHA1 Message Date
Folke Lemaitre
72dc6213f7
fix(explorer.tree): only strip trasiling forward slashes if not at root. Closes #2375 2025-10-29 14:18:11 +01:00
Folke Lemaitre
e1dc6b3bdd fix(explorer): windows path fixes 2025-10-25 16:22:44 -07:00
nickx00
7a5eb1036a
fix(explorer): mounted directories being detected as non-directories in Tree:expand (#2053)
## 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>
2025-09-25 12:45:01 +02:00
Folke Lemaitre
1142f46a27
perf(explorer): only update tree when diagnostics actually changed 2025-02-20 09:54:32 +01:00
Folke Lemaitre
bc902f7032
feat(compat): added svim, a compatibility layer for Neovim. Closes #1321 2025-02-20 06:59:44 +01:00
Folke Lemaitre
ab1889c35b
feat(explorer): opts.include and opts.exclude. Closes #1068 2025-02-11 22:22:04 +01:00
Folke Lemaitre
bc087d36d6
perf(explorer): no need to get git status with -uall. Closes #983 2025-02-07 09:54:04 +01:00
Folke Lemaitre
d1d55850ec
feat(explorer): added quick nav with [, ] with d/w/e for diagnostics 2025-02-07 08:59:37 +01:00
Folke Lemaitre
7f1b60d557
feat(explorer): added diagnostics file/directory status 2025-02-07 08:45:40 +01:00
Folke Lemaitre
8399465872
feat(explorer): file watching that works on all platforms 2025-02-05 13:28:16 +01:00
Folke Lemaitre
4c12475e80
feat(explorer): git index watcher 2025-02-05 11:10:03 +01:00
Folke Lemaitre
dfa79e0443
feat(explorer): show symlink target 2025-02-04 19:31:49 +01:00
Folke Lemaitre
e5f1e91249
fix(explorer.tree): symlink directories 2025-02-04 19:16:31 +01:00
Folke Lemaitre
ef9b12d680
fix(exporer.tree): and now hopefully on windows 2025-02-04 18:22:45 +01:00
Folke Lemaitre
6f5399b47c
fix(explorer.tree): fix linux 2025-02-04 18:18:26 +01:00
Folke Lemaitre
b560054669
fix(explorer): windows 2025-02-04 16:56:05 +01:00
Folke Lemaitre
6149a7babb
feat(explorer): rewrite that no longer depends on fd for exploring 2025-02-04 17:13:06 +01:00