Skip to content

fix(#1731 #1723 #1716): handle all external file system changes #1757

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

Merged
merged 16 commits into from
Nov 26, 2022

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented Nov 20, 2022

resolves #1731 #1723 #1716

Link directory nodes are the main issue here.

  • watchers refresh all folders (including links) when contents are externally modified
  • refresh profiling on absolute path
  • find-file locks and profiles on absolute path
  • find-file reloads path of the target file
  • create-file invokes find-file

Outstanding, follow up PR:

  • consolidate similar functions reloaders.lua and reload.lua

@alex-courtis alex-courtis marked this pull request as draft November 20, 2022 01:37
@alex-courtis alex-courtis changed the title fix(#1731): new file refresh all nodes, profile refresh fix(#1731): watchers refresh links and directories, find-file handles externally modified Nov 20, 2022
@alex-courtis alex-courtis changed the title fix(#1731): watchers refresh links and directories, find-file handles externally modified fix(#1731 #1723): handle all external file system changes Nov 20, 2022
@alex-courtis alex-courtis marked this pull request as ready for review November 20, 2022 06:06
@alex-courtis
Copy link
Member Author

I would be very grateful for a review and real world test over a few days.

This one has been tricky...

Copy link
Collaborator

@gegoune gegoune left a comment

Choose a reason for hiding this comment

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

Will use locally. Anything in particular to look out for?

@alex-courtis
Copy link
Member Author

alex-courtis commented Nov 20, 2022

Will use locally. Anything in particular to look out for?

Thank you.

  • Watchers off: find file not finding at all or selecting wrong node.
  • Watchers on: incorrect folder contents

Create file is still broken for some cases.

Edit: added fix for #1716 in the interests of testing simplicity

  • Watchers on: create-file not being found / selected

else
log.line("watcher", "node event executing refresh '%s'", node.absolute_path)
end
require("nvim-tree.explorer.reload").refresh_node(node)
Copy link
Member Author

Choose a reason for hiding this comment

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

This will still result in one refresh for each instance of the symlinked dir, however optimising that away requires significant complexity.

@alex-courtis alex-courtis changed the title fix(#1731 #1723): handle all external file system changes fix(#1731 #1723 #1716): handle all external file system changes Nov 21, 2022
@alex-courtis
Copy link
Member Author

Pulling the trigger. Thanks for testing @gegoune

This has been a difficult fix. If there are issues I plan to push forward with fixes rather than reverting again.

@gegoune gegoune deleted the 1731-refresh-all-folders-containing branch November 26, 2022 08:32
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.

Externally Created File Not Always Visible
2 participants