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

Listen out for files being renamed and moved, and update 'ignoredFiles' setting #47

Open
claremacrae opened this issue Apr 14, 2022 · 6 comments

Comments

@claremacrae
Copy link

I've got about 10 files ignored, and if I move them to a different folder, the settings don't get updated to reflect the new location, so I then have to re-ignore them, or remember to manually edit the settings file.

Might it be possible for move events to be detected, and the settings updated if the file is ignored, please?

Related: I wonder whether it updates the ignore list if an ignored file is renamed? If not, please could that be implemented too.

@claremacrae
Copy link
Author

If you can give an indication of the areas of code that would need updating, and how to trap renames and moves in Obsidian, then I'll have a go at submitting a PR for this.

@dvcrn
Copy link
Owner

dvcrn commented Apr 14, 2022

Hey! Actually it's already supposed to be doing that here:

https://github.com/dvcrn/obsidian-filename-heading-sync/blob/7759dee22ca0b75659dfbb4d3a352c7ccf86eebe/main.ts#L161-L176=

I wonder if you hit some case that didn't get caught by this

@claremacrae
Copy link
Author

claremacrae commented Apr 14, 2022

Brilliant - thanks for the swift reply!

I see the comment on the method (nice!):

Syncs the current filename to the first heading

I had selected 20 files in Obsidian's File Explorer/Navigator thing, and dragged them all to a new sub-folder. Several were ignored. So none were the current file...

I wonder if you hit some case that didn't get caught by this

Does that help?

@claremacrae
Copy link
Author

Related: What should the behaviour of the Options dialog be if any of the ignored files don't exist in that exact path? Warn? Icon marking missing files?

@claremacrae
Copy link
Author

There is also the case of renaming folders, which implicitly changes the path of all files inside...

@dvcrn
Copy link
Owner

dvcrn commented Apr 15, 2022

Hmm yeah it's possible that some of these cases aren't caught correctly with the current implementation

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

No branches or pull requests

2 participants