I am using
system() to change a buffer's file. I apply the same change to the buffer itself. I can't just reload the buffer because there are other unsaved changes.
When I come to write the buffer, Vim gives me:
WARNING: The file has changed since reading it!!! Do you really want to write to it (y/n)?
I do really want to write to it.
How can I avoid this warning?
I have tried adding a
FileChangedShell autocmd which doesn't do anything, but it does not get fired for
system() calls. So I added a
silent execute ':!', which seems to trigger the autocmd, but the screen gets all messed up – and vim still shows the warning.
Any ideas would be greatly appreciated!