jalvesaq / zotcite

Vim plugin for integration with Zotero
GNU General Public License v3.0
154 stars 13 forks source link

Error opening symbollic attachment #29

Closed dan123222123 closed 4 weeks ago

dan123222123 commented 3 years ago

Hi @jalvesaq!

I am currently using vimwiki with zotcite. My Zotero pdf library is different to the standard zotero library (Synced with OneDrive), so I am using symbolic file links in Zotero.

When I try to open an inserted link in my markdown document, I get an error

The file or folder smb://home/user/OneDrive/zotero-library/*.pdf does not exist.

Checking autoload/zotcite.vim file, I tried to echo fpath in zotcite#OpenAttachment. The resulting path was //home/user/OneDrive/zotero-library/*.pdf

When I changed the system call to open fpath[1:] instead of fpath, the file opens as expected. I did not test, but I assume that this workaround would break direct file links.

I believe a better fix would come from handling cases separately in zotcite#GetPDFPath, but I am not very good at vimscript :(

Thank you for this plugin!

jalvesaq commented 3 years ago

I don't know how to replicate the issue. I did the following:

  1. Moved a PDF from its directory to my home directory.
  2. Created a symbolic link to the PDF at its new path.

But I still can open the attachment with the <Leader>zo command.

If I change the code from fpath to fpath[1:] I will break the code for everyone else.

jalvesaq commented 1 month ago

I believe a better fix would come from handling cases separately in zotcite#GetPDFPath, but I am not very good at vimscript :(

I converted VimScript to Lua on the nvim branch which will soon be the master branch...