GNOME Bugzilla – Bug 671250
Gedit not seeing that file changed on disk when replaced by file with same name
Last modified: 2014-07-26 12:43:30 UTC
1. make two test files with the same name, but in two different directories and with different content 2. make sure one of them is older than the other (in terms of creation and modification time, I didn't test which of those matters) 3. open the newer file in gedit (do NOT close gedit from this point on) 4. move the newer file to a different location 5. move the older file to be in the same directory where the newer file was in step 3 6. double click the older file in a file manager, the gedit window shows the contents of the newer file, i.e., it does not show the usual "File contents changed on disk, reload or cancel?" question.
See also: https://bugs.launchpad.net/gedit/+bug/893521
I confirm this bug.
This also applies to files used with append ( >> ). (Got 3.8 here, which is latest available packaged for Ubuntu (AFAIK). Reproduction: - Have a text file text.txt - Open this file in gedit - Append some text in console echo " mary had a little lamb " >> text.txt (expected) You should get prompted "file has changed on disk. Do you want to reload?" (actual) It works very unreliably. To me it looks that from a certain number of lines (i. e. when the file grows to some decent size) this doesn't work at all anymore. (WORKAROUND) Use tabs! (case 1 - when no tabs except for the one with the file) Create a pseudo tab just next to the tab where your file is edited. Switch to pseudo tab and then back to file, and you WILL get that prompt. (case 2 when other tabs _are_ available) Just switch to random tab and back to file you're editing. Prompt will show up. Currently it's about like you have to "kick gedit in the butt" so that it display the orange 'File has changed' infobox. :)
Created attachment 281324 [details] [review] GeditDocument: better externally modified check
The bug is actually still in gedit. I think the patch will work fine, but I'm not 100% sure (maybe the mtime can slightly be modified without any modification, but I doubt it).
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Review of attachment 281324 [details] [review]: pushed