michal-h21/vim-zettel

ZettelInsertNote fails with multiple wikis: Can't open file...

rcmosher opened this issue · 1 comments

ZettelInsertNote is not working for me. It is looking in the wrong directory. Instead of using the directory of the selected file to insert it uses the directory of the first wiki in g:vimwiki_list. It does this regardless of what ZettelSetActiveWiki is set to, or if a file from my zettel wiki is open.

It results in the following error.

Error detected while processing function 172[30]..29_callback[25]..function 172[30]..29_callback:
line 23:
Vim(let):E484: Can't open file /home/user/Documents/Vimwiki/210906-132626-14.md

My g:vimwiki_list is set as follows. I'd expect the 2nd wiki to be used. Though really it should just use the full path of the selected file.

  let g:vimwiki_list=[
    {'path': '~/Documents/Vimwiki/',
     'syntax': 'markdown', 'ext': '.md'},
    {'path': '~/Documents/Zettelkasten/',
     'syntax': 'markdown', 'ext': '.md', 'auto_tags': 1, 'auto_toc': 1}
  ]

I'm using Vim 8.2. vim-zettel is up to date.

It should work correctly now.