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
Bug: When enabled, Templater Folder Templates stop working #40
Comments
Are you able to get around this when you ignore the Templater/ folder in this plugins settings? |
You mean the folder where I store my templater templates? That folder I do already ignore |
I am also running into this. |
Same issue here |
Same! |
Since I don't use templater it would be helpful if anyone had ideas what to try to resolve this instead of just commenting same 😇 |
The issue appears to be that this plugin adds content prior to templater's hook to add the default template for a given folder. Perhaps adding an option to have Obsidian Filename Heading Sync only add titles to pages with content would make them compatible with each other? |
How about adding a option to disable the "file open" event hook? So it only modified on save Another idea, though hacky, would be to add artificial delay after a file has been opened I'm guessing there is no way to identify a templater file since it's empty first? If we can then we could just add a ignore rule |
that would work, if you restricted it to the opened file – applying the sync to the file you are leaving to open another is part of what I (and many) people like about the plugin.
maybe a bit less hacky would be to check file creation date before running the sync, and only run the sync if the fiel creation is x seconds ago – I assume it is during that time span that templater runs it's templates? |
Let's try to make the file-open hook optional and see if that solves some of these issues. I also like the functionality that a new file automatically has the headline synced on creation, so I don't want to mess with that too much From my understanding templater is creating the file first, then inserting the templated content? So both plugins overwrite each other. The best would be if there was some way to detect that a file has been created by templater... |
Ah I see, so it hooks into file creation... Wonder if we can extract that setting somehow (or detect that it's enabled) and then change the behavior of filenamen-heading-sync |
Automatically changing behavior if this plugin depending on the templater setting would be great, but I think a simple toggle in the settings of this plugin would ahead be a good start. |
Hey folks! 1.6.0 is out with an option to disable the file-open hook Please give it a go and check if this fixes issues with templater |
seems it fixes the issue for me! :) |
Great to hear! Let's wait for some of the others to report back, then we can close this for now. Would be good if we can find some automatic solution to detect templater |
Disabling the "Use File Open Hook" fixes the issue for me as well. Thanks a lot :) |
Great, I'll close this for now |
Disabling the "Use File Open Hook" does not fix the issue, at least not anymore... 🥲 |
I've created an issue over at the templater repository - SilentVoid13/Templater#924 |
I think this is due to the plugin inserting text into the file before Templater's "on the creation of an empty file" condition is checked.
The text was updated successfully, but these errors were encountered: