(git 089726aa0662f085757c150f35cf63b624fa44f8 2011-02-14 22:27:48, Vim 7.2)
When doing F9-completion, changes to current file are lost when all of the following conditions are true:
1. The project has multiple .tex files
2. The F9-completion falls back to the default case (texviewer.vim:183)
3. <cword> is found in another .tex file
4. Tex_WriteBeforeCompletion is not set to 1 (It is not set by default)
The cause is that Tex_Grep (called in texviewer.vim:190) closes the current buffer without saving and opens the file where a match was found. A few possible fixes:
1. let g:Tex_WriteBeforeCompletion = 1 in texrc
2. Give a defautlt value of 1 when reading Tex_WriteBeforeCompletion in texviewer.vim:78
I didn't quite get the point of this fallback functionality, so perhaps there is a more suitable solution. Nevertheless, it is extremely frustrating to lose changes just because you press one button that shouldn't do anything bad...
Bah, I messed the line numbers up, should be 183->180, 190->187, 78->55. Sorry.