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

Reverting local change dir when early return #28

Closed badouralix closed 7 years ago

badouralix commented 7 years ago

I made up my mind about a previous question in #25 I think that the user environment should not be changed by the plugin. Thus, as the current directory is changed during the script runtime, it has to be reset to its previous value at the end of the script execution, whatever the result is (success or failure).

I'll probably look furthermore to try to avoid using lcd %:p:h, but for now this patch does the job.