After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 491491 - Auto save's problem
Auto save's problem
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: editor: scintilla
2.2.1
Other All
: Normal minor
: ---
Assigned To: Sébastien Granjoux
Anjuta maintainers
: 502470 528955 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-10-29 19:18 UTC by shangtaoxy
Modified: 2009-01-29 20:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description shangtaoxy 2007-10-29 19:18:58 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:
Comment 1 Johannes Schmid 2007-11-02 12:09:48 UTC
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.
Comment 2 Johannes Schmid 2008-04-19 22:50:51 UTC
*** Bug 528955 has been marked as a duplicate of this bug. ***
Comment 3 Johannes Schmid 2008-04-19 22:51:38 UTC
Hopefully this will get fixed once we move over to gio/gvfs.
Comment 4 Sébastien Granjoux 2008-08-05 20:37:11 UTC
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. 
Comment 5 Sébastien Granjoux 2008-08-05 20:42:27 UTC
*** Bug 502470 has been marked as a duplicate of this bug. ***
Comment 6 Pacho Ramos 2008-12-07 10:34:18 UTC
Seems that 2.24 is still affected:
https://bugs.gentoo.org/show_bug.cgi?id=248747
Comment 7 Pacho Ramos 2008-12-19 16:09:33 UTC
Can anybody reopen this? Or original reporter reply is required?

Thanks
Comment 8 Johannes Schmid 2008-12-19 18:08:16 UTC
If you can still reproduce it => Reopened!
Comment 9 Sébastien Granjoux 2008-12-31 09:44:01 UTC
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 ?
Comment 10 Andreas Volz 2008-12-31 09:59:14 UTC
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.
Comment 11 Massimo Cora' 2008-12-31 10:44:38 UTC
(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.
Comment 12 Johannes Schmid 2008-12-31 11:19:10 UTC
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.
Comment 13 Andreas Volz 2008-12-31 14:45:23 UTC
@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.
Comment 14 Massimo Cora' 2008-12-31 14:51:47 UTC
ok that would confirm my theory.
Comment 15 Sébastien Granjoux 2008-12-31 18:59:14 UTC
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 ? 
Comment 16 Johannes Schmid 2008-12-31 19:11:39 UTC
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.
Comment 17 Sébastien Granjoux 2008-12-31 20:07:38 UTC
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.

Comment 18 Massimo Cora' 2009-01-01 16:39:03 UTC
(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
Comment 19 Sébastien Granjoux 2009-01-25 14:42:23 UTC
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.
Comment 20 Sébastien Granjoux 2009-01-25 22:02:47 UTC
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. 
Comment 21 Sébastien Granjoux 2009-01-29 20:22:49 UTC
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.