Skip to content

Commit

Permalink
feat: only use bibdesk in cite context when possible
Browse files Browse the repository at this point in the history
refer: #2908
  • Loading branch information
lervag committed Apr 29, 2024
1 parent 42f573b commit 310894b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion autoload/vimtex/context/cite.vim
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ function! s:actions.create(entry) abort dict " {{{1
call add(l:new.menu, {'name': 'Open in Zotero', 'func': 'open_zotero'})
endif

call add(l:new.menu, {'name': 'Open in BibDesk', 'func': 'open_bdsk'})
if vimtex#util#get_os() ==# 'mac'
let l:output = vimtex#jobs#capture(
\ 'osascript -l JavaScript -e ''Application("BibDesk").id()''')
if join(l:output) =~# 'edu.ucsd.cs.mmccrack.bibdesk'
call add(l:new.menu, {'name': 'Open in BibDesk', 'func': 'open_bdsk'})
endif
endif

return l:new
endfunction
Expand Down

0 comments on commit 310894b

Please sign in to comment.