Skip to content

Instantly share code, notes, and snippets.

@xuhdev
Created October 9, 2014 09:42
Show Gist options
  • Save xuhdev/18364cf91b09cd02dd41 to your computer and use it in GitHub Desktop.
Save xuhdev/18364cf91b09cd02dd41 to your computer and use it in GitHub Desktop.
patch to fix live preview
diff --git a/plugin/latexlivepreview.vim b/plugin/latexlivepreview.vim
index 03a5df5..767b64e 100644
--- a/plugin/latexlivepreview.vim
+++ b/plugin/latexlivepreview.vim
@@ -90,9 +90,11 @@ vim.command("let b:livepreview_buf_data['tmp_dir'] = '" +
tempfile.mkdtemp() + "'")
EEOOFF
- let b:livepreview_buf_data['tmp_src_file'] =
- \ b:livepreview_buf_data['tmp_dir'] . '/' . expand('%:r') .
- \ '.' . expand('%:e')
+ if !has_key(b:livepreview_buf_data, 'tmp_src_file')
+ let b:livepreview_buf_data['tmp_src_file'] =
+ \ b:livepreview_buf_data['tmp_dir'] . '/' . expand('%:r') .
+ \ '.' . expand('%:e')
+ endif
silent exec 'write! ' . b:livepreview_buf_data['tmp_src_file']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment