GNOME Bugzilla – Bug 491491
Auto save's problem
Last modified: 2009-01-29 20:22:49 UTC
Please describe the problem: when i am editing a file,once the file was auto saved or saved by me, the dialog appears: Alarm: the file "aa.c" 's content in disk is newer than the content of current file which you are editing ,reload this file now? No Reload this happens very often,and it makes me angry. Steps to reproduce: 1. edit a file,you save it by hand or auto saved by the program. Actual results: nothing happens. Expected results: I do not want this appears. Does this happen every time? no,but very often . Other information:
Yes, this happens because gnome-vfs is damn stupid. For the sourceview editor there is a preference option to disable the reload-warning. Maybe we should add the same for scintilla.
*** Bug 528955 has been marked as a duplicate of this bug. ***
Hopefully this will get fixed once we move over to gio/gvfs.
I have already seen this but not all the time. We have moved to gio and I don't remember the last time that I have get it. Could you check if it's fixed in the latest version on svn ? Or if you prefer, Anjuta 2.5.0, the change to use gio has been done before.
*** Bug 502470 has been marked as a duplicate of this bug. ***
Seems that 2.24 is still affected: https://bugs.gentoo.org/show_bug.cgi?id=248747
Can anybody reopen this? Or original reporter reply is required? Thanks
If you can still reproduce it => Reopened!
I have removed the 1s delay in scintilla, it could be worst now. I would like to fix it but it's difficult to reproduce. Is there someone, who has found a configuration where the message always pop up ?
Here I've a way to reproduce it. 1. Open a existing file from the project 2. Create a new empty file 3. Switch to the exisiting file and copy some text with Crtl-C 4. Insert that text with Ctr-V in the new file 5. Save that file (as xxx.cpp) 6. See the popup dialog Not sure if all steps are needed. But here I could reproduce it very often that way.
(In reply to comment #10) > Here I've a way to reproduce it. > > 1. Open a existing file from the project > 2. Create a new empty file > 3. Switch to the exisiting file and copy some text with Crtl-C > 4. Insert that text with Ctr-V in the new file > 5. Save that file (as xxx.cpp) > 6. See the popup dialog > > Not sure if all steps are needed. But here I could reproduce it very often that > way. > when you do the point 4, are you inserting at the end of the file? Please have a look at the steps of bug #564661, which seems a duplicate of this one, and please tell me if you get the same.
It's not really a problem of scintilla - sourceview has about the same. To reproduce if you either need a slow PC or you need to generate a high IO load so that the file writing is somehow delayed and the "file-changed"-signal is emitted after the specified delay. I had actually assumed the gio would be more clever with this signal but it seems that it is not.
@Massimo Cora': It's a simply empty file. But I think the inserted code ends with "}" and no newline. But I've to check it.
ok that would confirm my theory.
What do you think if instead of asking Anjuta always reloads the modified file if it has been saved ? I have seen that kdevelop is doing this and it will solve the current problem. The current behavior could be annoying, by example if you add a tool which make some modifications in the file. When you launch it, the current file will be saved, the tool is doing its job (doing some complex replacements by example) but then you will get a question to reload the file. Is there a situation where a file is changed outside Anjuta and you don't want to reload it ?
Yes, sometimes I accidentely delete a file or do an svn update and it's really nice when you can save your file afterwards without having it automatically reloaded.
Deleting a file is something different. I don't plan to automatically reload a empty file, if the file is deleted. The sourceview plugin do it now but I think this is rather a bug (see #549958), gedit don't do it. Then, if you do a svn update by accident, the file will be reload automatically only if it is saved, so you should keep all your modifications. So I don't think it's really a problem. Moreover, if you do svn update on purpose, all modified files will be reloaded without needing any confirmation, I think it's the most common case.
(In reply to comment #17) > Deleting a file is something different. I don't plan to automatically reload a > empty file, if the file is deleted. The sourceview plugin do it now but I think > this is rather a bug (see #549958), gedit don't do it. > > Then, if you do a svn update by accident, the file will be reload automatically > only if it is saved, so you should keep all your modifications. So I don't > think it's really a problem. > > Moreover, if you do svn update on purpose, all modified files will be reloaded > without needing any confirmation, I think it's the most common case. > sounds good to me
I think I have fixed this in scintilla and committed the changes on svn trunk. A file is automatically reloaded if the user hasn't changed it and a message area appears if it has been changed.
It doesn't solve the problem because reloading the document change the current position and selection. Moreover if the auto save arrive while you are typing the buffer is modified and you still get the warning message.
I think I have fixed it. Scintilla plugin keep the content of what have been saved recently, so when the file changed, it compares the change with what should be saved and don't display a message if both are identical.