Bug 396757 - doing a search-replace can clash with an open file
Summary: doing a search-replace can clash with an open file
Status: RESOLVED DUPLICATE of bug 396824
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Search-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2012-12-17 09:48 EST by david collier CLA
Modified: 2012-12-18 06:16 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description david collier CLA 2012-12-17 09:48:10 EST
I find it hard to believe that this actually happens as it seems such a fundamental bug.

If I open a file, edit it, then do a search-replace which changes something in the same file, it appears that I cannot then save my changes made in the IDE because "the file on disk has changed"

I am about to report a similar issue - in that if I use egit to switch to another branch, it will do so while I have unsaved changes in open editor windows. I mention it in case they are related issues on my m/c.
Comment 1 Paul Webster CLA 2012-12-17 12:59:19 EST
(In reply to comment #0)
> I find it hard to believe that this actually happens as it seems such a
> fundamental bug.
> 
> If I open a file, edit it, then do a search-replace which changes something
> in the same file, it appears that I cannot then save my changes made in the
> IDE because "the file on disk has changed"

This works for me.

How can I reproduce this?  Just opening a file, doing search and replace (CTRL+F), and then saving works for me.

Did you switch branches in git between starting to edit the file and trying to save?

PW
Comment 2 Dani Megert CLA 2012-12-18 03:00:45 EST
I also cannot reproduce this using 'File Search' and replace something.
Comment 3 david collier CLA 2012-12-18 05:53:38 EST
OK - I have done a simple-minded one-file test, and it works fine.

So - either the "file changed on disk" message only comes up in more complex situations, OR it comes up if egit has got involved somewhere.

I have reported my feelings that egit should not silently switch branches with unwritten edits, so maybe if that is dealt with the phenomenon reported here will quietly evaporate.
Comment 4 Dani Megert CLA 2012-12-18 06:00:59 EST
Please reopen if you have more details.

Hint: If you enable 'Refresh on access' on the General > Workspace preference page, you should no longer see this problem.
Comment 5 david collier CLA 2012-12-18 06:16:07 EST

*** This bug has been marked as a duplicate of bug 396824 ***