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

fix using different location other than storage #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adam-coates
Copy link
Contributor

Moving pdfs to a different location other than the default zotero storage results in unable to find pdf (e.g. using the Zotero plugin zotmoov.

Therefore, change the way in which the file path to pdfs is created when using a file path other than storage is used. Otherwise the file path still looks for directory /storage before the pdf name and if not falls back to using attachemtents:<pdfname>

I added some debug statements in case it doesn't work for the default Zotero storage location. I am unable to test if this fix works for the default location since I have already moved pdfs.

Moving pdfs to a different location other than the default zotero
storage results in unable to find pdf. Therefore change the way in which
the file path to pdfs is created when using a file path other than
storage is used. I create some debug statements in case it doesn't work
for the default location. I am unable to test if this fix works for the
default location or not.
@jmbuhr
Copy link
Owner

jmbuhr commented Mar 2, 2025

Looks good! I didn't properly test it, yet, because I got sidetracked by an issue with having the snacks.nvim picker as vim.ui.select (I seems to interpret the closing of the telescope window as its own closing and fires off its on_close callback before one can make the choice between pdf/url/zotero).

But I think this is good to go, we can remove the debug logs and only keep the log for when it can't open.

@adam-coates
Copy link
Contributor Author

adam-coates commented Mar 2, 2025

Great, yeah I was also silently working on trying to integrate the snacks picker with this plugin since the deprecation of dressing.nvim, but I didn't get too far with it. Using snacks I too get the immediate close of vim.ui.select making selection not possible with snacks so just currently sticking telescope and dressing.nvim for now. Snacks support would be great though of course, I liked the idea behind what obsidian.nvim did with supporting multiple pickers.

@jmbuhr
Copy link
Owner

jmbuhr commented Mar 2, 2025

What a coincidence! I figured out that stopping snacks from creating any of its autocommands (disabling this line: https://github.com/jmbuhr/snacks.nvim/blob/453333530bf9cbb5930eae8471bc3a23149c9343/lua/snacks/win.lua#L477) does prevent it from closing (but of course would break other things), but haven't figured out why exactly the closing of the telescope window triggers the WinClose autocmd of the snacks picker window (as it is using its window ID as a pattern, which should work). So I didn't put together a minimal reproducible example for a snacks.nvim issue. Let's ping us here (or in the respective issue) in case one of us manages that before the other so we don't open two issues.

Snacks support for the whole zotero picker would also be interesting indeed. I'll have to look into how similar the interface are between the two to see how much overhead it is. In general it seems the community is gravitating towards unified standards for these sorts of interfaces, which I find exiting. For example, I just added blink.cmp support to my pandoc references nvim-cmp source and that was super simple, almost no modification required.

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

Successfully merging this pull request may close these issues.

2 participants