seethroughdev / obsidian-recipe-grabber

MIT License
59 stars 8 forks source link

Does not work if tab is in Reading mode #29

Closed Ovyerus closed 6 months ago

Ovyerus commented 6 months ago

I was having a bunch of trouble with the plugin seemingly being completely broken and just creating blank files with no error popups or in the console. Had an idea today to try switch "Default view for new tabs" back to Editing instead of Reading and it works fine.

Dug through the plugin code quickly and found what I suspect to be the cause: assuming that there is an editor instance open.

https://github.com/seethroughdev/obsidian-recipe-grabber/blob/330823bc999a4ef8e5b12f59847eb9b05c3f34d3/src/main.ts#L362-L367

Perhaps Vault.append should be used instead of manipulating the editor?

seethroughdev commented 6 months ago

Sorry for the delay in responding here, @Ovyerus . This makes perfect sense, and your PR is really appreciated! Will follow up in the PR. Thank you again!