michal-h21 / vim-zettel

VimWiki addon for managing notes according to Zettelkasten method
MIT License
557 stars 73 forks source link

Prevent duplicate file creation #78

Closed shaine closed 2 years ago

shaine commented 3 years ago

When a file in a subfolder is open and :ZettelNew is invoked, vim-zettel opens a file in that directory and saves it, and then opens the same filename in the root of the wiki and saves that file, resulting in the same file written to two different locations.

This change forces the create function to always operate in the root to prevent this behavior. I believe this might be an example of a "load bearing bug" and people might have their workflows now relying on the counter-intuitive behavior, so I'd understand choosing to not to change the behavior. I'm sure there are better approaches to solving this, and I'm uncertain if there are other use cases within vim-zettel that this might negatively impact, but this does correct :ZettelNew's behavior against what I think its expectations are.

michal-h21 commented 2 years ago

Thanks!