Skip to content
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

ZettelSetActiveWiki and multiple Wikis #111

Open
MaralWa opened this issue Jun 27, 2021 · 1 comment
Open

ZettelSetActiveWiki and multiple Wikis #111

MaralWa opened this issue Jun 27, 2021 · 1 comment

Comments

@MaralWa
Copy link

MaralWa commented Jun 27, 2021

I have a main VimWiki for general topics and several project related VimWikis.

If I call ZettelOpen while I am editing a file of my main Wiki ZettelOpen behaves as expect. For example when I call ZettelOpen and search notes containing topic the result list contains topic.md and I can open it with RETURN. When I call the function :messages the messages are:

[DEBUG] filename: topic.md
[DEBUG] wikiname: topic
[DEBUG] dir: /Users/Maral/Documents/vimwiki/
[DEBUG] wikidir: /Users/Maral/Documents/vimwiki/

ZettelOpen opened file /Users/Maral/Documents/vimwiki/topic.md

Now I switch to another wiki by opening the index file of the other vimwiki, for example /Users/Maral/Documents/otherwiki/index.md If call ZettelOpen the result list always contains only notes from the main wiki.

othervimwiki does not contain any note with the word topic but it does contain notes with the word second. But :ZettelOpen second does not find any results. If call :ZettelOpen topic (remember I am still in otherwiki) the result list contains the note topic.md from my main wiki. But if I hit RETURN ZettelOpen opens the note /Users/Maral/Documents/otherwiki/topic.md which is empty because it did exist in otherwiki before.

Why this happened I understood when called :messages:

[DEBUG] filename: topic.md
[DEBUG] wikiname: topic
[DEBUG] dir: /Users/Maral/Documents/vimwiki/
[DEBUG] wikidir: /Users/Maral/Documents/otherwiki/

These were the messages after I had called :ZettelOpen topic while I edited /Users/Maral/Documents/otherwiki/index.md, i.e. the index of otherwiki. Hence the issue is that ZettelOpen search in directory dir but opens results relative to wikidir:

My conclusions are

  • ZettelOpen always searches in the vimwiki that was opened first.
  • ZettelOpen always opens a file relative to the path of the file the user edited when they called ZettelOpen, i.e. only works correctly if it was called from a note within the root directory of vimwiki the was opened first.
  • ZettelSetActiveWiki has absolutely no effect. I played around with it but it did not change anything.

Ciao

Maral

@michal-h21
Copy link
Owner

Hi, sorry for the late reply. I am now going over older issues and I am trying to fix them.

I think this issue was fixed in the meantime, ZettelOpen now lists only notes from the currently selected wiki, and you can select a different wiki using ZettelSetActiveWiki. It shouldn't matter in which directory you are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants