mo-seph / obsidian-note-from-template

Simple plugin to create Notes from a template, and fill in fields defined there
MIT License
108 stars 9 forks source link

Fix for ignored shouldCreateOpen options #40

Closed OsoRojo closed 11 months ago

OsoRojo commented 2 years ago

It seems that at some point the name of newFile and the actual file created during plugin execution got out of sync. I removed the declaration (const) from the file creation, and changed the name back to newFile, effectively repointing the null reference, which is what the downstream code is looking for in lines 138 through 142.

OsoRojo commented 2 years ago

Closes the following issues:

Create and open · Issue #33 · mo-seph/obsidian-note-from-template · GitHub Create and open & Create and open in new pane not working · Issue #27 · mo-seph/obsidian-note-from-template · GitHub

spirosoik commented 2 years ago

+1 to merge this

camdencamden commented 2 years ago

Until this is merged, a quick hack (which doesn't require rebuilding) is simply to open the main.js file...

And find this line:

const file = yield this.app.vault.create(path, filledTemplate);

And add this new line after it:

newFile = file; // Hacky fix for soon-to-be-addressed bug.
mo-seph commented 11 months ago

Thanks!