Hi!
I would suggest check differences between edited and saved file at the saving process. It would be more correct to compare the checksum file before changing and the checksum saved file, so could accurately determine that someone had changed the file, and if file would be saved this changes may be loose. I would suggest to launch differ tool such as meld for merge these changes.
-- Best Regards, Mike Gavrilov.