Skip to content

Commit

Permalink
fix: use jobstart to open pdf via #21 from adam-coates/fix/pdfopener
Browse files Browse the repository at this point in the history
change to use jobstart
  • Loading branch information
jmbuhr authored Feb 27, 2025
2 parents 48a6f82 + 91cbb54 commit 69a66fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/zotero/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ local function open_url(url, file_type)
if file_type == 'pdf' and M.config.pdf_opener then
-- Use the custom PDF opener if specified
vim.notify('Opening PDF with: ' .. M.config.pdf_opener .. ' ' .. vim.fn.shellescape(url), vim.log.levels.INFO)
vim.fn.system(M.config.pdf_opener .. ' ' .. vim.fn.shellescape(url))
vim.fn.jobstart({ M.config.pdf_opener, url }, { detach = true })
elseif vim.fn.has 'win32' == 1 then
open_cmd = 'start'
elseif vim.fn.has 'macunix' == 1 then
Expand All @@ -81,7 +81,7 @@ local function open_url(url, file_type)
open_cmd = 'xdg-open'
end
vim.notify('Opening URL with: ' .. open_cmd .. ' ' .. vim.fn.shellescape(url), vim.log.levels.INFO)
vim.fn.system(open_cmd .. ' ' .. vim.fn.shellescape(url))
vim.fn.jobstart({ open_cmd, url }, { detach = true })
end
local function open_in_zotero(item_key)
local zotero_url = 'zotero://select/library/items/' .. item_key
Expand Down

0 comments on commit 69a66fe

Please sign in to comment.