Closed tomaszwojcik closed 7 years ago
It should not happen though. Can you stop Vim and see whether the file still exists? The warning should come because there IS a file with a name of latex-test.tex.swp
there.
I've tried that. After quitting Vim the swap file is erased.
I see the problem now. It's because you have set swp file to a specific directory, but the command to create a temp file also asks Vim to create the exact same file in that directory. This would not be a problem if you always have swp file in the same directory.
Anyway, this is a bug and I'm gonna fix it.
Hold on -- seems this is a problem of your configuration or a bug in Vim. Can you post the part of configuration which you set the path of the swp file?
My tmp/backup config:
set backupdir=~/.vim_bck
set directory=~/.vim_tmp
OK, the problem is found.
Open any file with Vim with your configuration, run the following command twice:
:write! /tmp/the_file_name.ext
You'll see the error message pops up. Because Vim thinks this file has a corresponding swp file. Seems this is a defect that Vim doesn't create a prefix for the swap files for files in different directories.
Try to add the following to your vimrc file and apply this patch. Let me know whether it works for you.
autocmd BufEnter *.tex let b:livepreview_buf_data['tmp_src_file'] = '/tmp/my_name.tex'
After applying the patch and adding command to the vimrc I open any tex file and I get the following error:
Error detected while processing BufEnter Auto commands for "*.tex":
E121: Undefined variable: b:livepreview_buf_data
Just add double slashes to paths in your config to avoid name collision:
set backupdir=~/.vim_bck//
set directory=~/.vim_tmp//
harius's solution worked great for me.
Your solution worked for me too, harius - thanks!
As the name of the file written in the tmp dir is essential to make the plugin work on a multi files project, the only lasting solution is to use @harius trick. I'm closing this issue after referencing it in the project readme. Feel free to re-open it whether something related happens.
Hello
I use MacTeX and Mac OS X Preview as my preview program. When I start the
:LLPStartPreview
and save the file I get the following error:I don't want to disable the swap.