xuhdev / vim-latex-live-preview

A Vim Plugin for Lively Previewing LaTeX PDF Output
https://www.topbug.net/blog/2013/06/13/live-preview-of-latex-in-vim/
GNU General Public License v3.0
834 stars 74 forks source link

open -a Preview does not work as a live preview command anymore #108

Closed ayazhafiz closed 4 years ago

ayazhafiz commented 4 years ago

Expected behavior

Be able to start a live preview with the Preview application on Mac by setting let g:livepreview_previewer='open -a Preview'.

Actual behavior

This no longer works and the plugin reports the error "Neither the explicitly set livepreview_engine NOR the defaults are executable". This is because prior to #99, explicitly-set engines were not checked to be executable commands; in #99, this check was added for default and explicitly set engines:

https://github.com/xuhdev/vim-latex-live-preview/blob/32d1a911641e08c11b3f82ba886540cbae0b7513/plugin/latexlivepreview.vim#L271-L275

This doesn't work for open -a Preview because it is not a single executable command; only open is an executable in this case.

Steps to reproduce

Tell us how it occurs

  1. set let g:livepreview_previewer='open -a Preview'
  2. Try to launch LLP

System configuration

VIM - Vi IMproved 8.2
ayazhafiz commented 4 years ago

Happy to submit a patch; I tried looking for an executable alternative for full commands but could find none. Perhaps the best option is to revert the behavior. For now a workaround is to alias open -a Preview.

xuhdev commented 4 years ago

Thanks for the report. It's been very difficult for me to find a MacOS machine and test the issue. Feel free to submit a patch.