[BLUEJ-1288] Annoying "File on disk has changed"
If I edit a java file on a mounted samba share, I get "The source file has changed on disk. Do you want to reload it from disk? This will discard changes made here in the editor" every time I change more than about 10 characters and leave a curly bracket.
We are using version 4.2.2 on Debian 10 using Xfce.
Maybe it's the same bug as in Cloud9 editor ([https://community.c9.io/t/file-on-disk-has-changed-annoying-message/7792/15).] A developer gave this explanation for it:
Here's what's happening:
- Autosave saves the file
- While the file is saving you make a change in the editor
- After the save is complete the system detects that the file has changed.
- The system then compares the timestamp on the saved file, and the timestamp of your last edit, determines that the file is newer (because you made the edit while it was still saving) and displays the prompt saying the file has changed on disk.
- If you click reload from disk it loses those changes you made while the file was saving.
I'm working on a fix for this now, unfortunately it's a hard problem to solve because we don't want to accidentally miss file updates on disk if they're made at roughly the same time an edit is made in the editor (say if one collaborator changes a file in the editor while another checks out a different version of that file in git at the same time).
It's really annoying, I beg for an autosave option that can be turned off.
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 5.0.0