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

fix(filesystem): Add new error handlers for getting directory children #1343

Merged
merged 10 commits into from
Feb 7, 2024

Conversation

pynappo
Copy link
Contributor

@pynappo pynappo commented Feb 5, 2024

Similar to #960 but for get_children_async.

Sometimes, get_children_async may try to read from folders with restrictive permissions and libuv will error out. For example, I use scan_mode = "deep", and opening neo-tree in the Windows $HOME results in a lot of errors because Windows puts a lot of folders with restrictive permissions there (for some reason). This PR will just callback with an empty list of children in that case.

On a tangential note, I think the fs_scan file could use a run of stylua, some code seems to have extra indentation and there's function (...) (note the space) instead of function(...). I didn't want to make the diff too big for a small bugfix though.

If err exists, dir is nil anyways (at least from my understanding)
@pynappo pynappo changed the title fix(filesystem): Add error handler for get_children_async() fix(filesystem): Add error handlers for get_children_(sync|async)() Feb 7, 2024
@pynappo pynappo changed the title fix(filesystem): Add error handlers for get_children_(sync|async)() fix(filesystem): Add new error handlers for getting children of a directory Feb 7, 2024
@pynappo pynappo changed the title fix(filesystem): Add new error handlers for getting children of a directory fix(filesystem): Add new error handlers for getting directory children Feb 7, 2024
Copy link
Contributor

@cseickel cseickel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@cseickel cseickel merged commit 68db926 into nvim-neo-tree:main Feb 7, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants