Fix: do not store entries for non-existent folders#137
Fix: do not store entries for non-existent folders#137kaihowl wants to merge 1 commit intoSidOfc:masterfrom
Conversation
|
I see indeed. I haven't checked it out yet, but it seems related to I think I'm going to look at this from a different angle since if you're viewing The problem lies a bit deeper than just some wrongly cached data, cheers for bringing it to my attention and bringing a PR nonetheless! I'll look at it a bit more in-depth somewhere this week 👍 |
|
@SidOfc, you are right: One could also go ahead and define what happens if a view is open and the root folder gets deleted. Nonetheless, having the method I only brought the PR to show the minimal changes needed to have somewhat saner behavior. Maybe you could consider bringing in this 'breakfix' first and then go for a bigger refactoring? :) And because I never get tired of saying so: Thank you very much for investing time in this plugin. It is still the best file viewer I have used so far in nvim. |
|
No problem, happy to hear it still serves you well :) As for merging in this fix, I've already gone ahead and wrote a small patch in a branch patch/removed-view. What it does is while inside a folder which is removed, it closes the view and scrubs it from the list of active views. Furthermore, if the view was the only window, a regular After implementing this I could no longer reproduce the "hanging" empty folder. Can you confirm this fixes the problem for you as well? (Perhaps some OS differences make this a "works on my machine" kind of thing) |
|
Can confirm that the branch also works in my environment. Thank you! |
|
Thanks for confirming! I'll make proper release later today so that you can revert back to master. I'll close this PR as it won't be necessary anymore. Thanks for the effort though, much appreciated! |
|
I see that 0.20.1 is released with the fix included. With nvim using the plugin from |
Repro:
When running the above script, one ends up with the folder
hellopermanently empty in every carbon view. Despite the folder having children on the disk.Fixed by distinguishing an empty folder from a non-existent folder in
entry:get_children. A failure fromfs_scandiris otherwise indistinguishable from an empty but existing folder.