Bug 396831 - Add option to save dirty files before replacing text
Summary: Add option to save dirty files before replacing text
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Search-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-18 07:39 EST by david collier CLA
Modified: 2012-12-19 11:40 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-18 07:39:23 EST
You could see this as a question of 'philosophy' but it has the potential to cause annoying loss of work.

If I have a file opened in the editor, and run a global exchange on the project, which affects the contents of the open file, but then abandon the edit, the global exchange is lost for that file.

You may say 'so what' but if it affects the name of a project-wide global variable, the project ain't going to compile after - and in a scripting language you may not even get any warning you've screwed stuff up, you may simply find the code in that file now affects a write-only global.

I think that either:

1. global exchanges should be applied to the "on-disk" copy of a file which is open in the editor, as well as to the open version.

or if that is too contentious -

2. any global exchange which would affect a file open in the editor should need confirmation with a pop-up box, preferably with a "save current edits before exchange" button.
Comment 1 Dani Megert CLA 2012-12-18 09:07:12 EST
Also other operations (e.g. refactoring) done outside the editor will not save the editor if it is dirty. For refactorings there's an option to save upfront. We could offer a similar option for Search.
Comment 2 david collier CLA 2012-12-19 05:33:08 EST
Dani - I wondered if it was something that was falling down a hole between the egit team and the IDE team.

It has caught me a couple of times, and it looks like a no-brainer to pop up a box saying "shall I save your dirty windows now before switching branches?

How do I/you terminate this ticket - is there a "resolved - transferred to wishlist" 'out' ??
Comment 3 Dani Megert CLA 2012-12-19 06:05:07 EST
(In reply to comment #2)
> Dani - I wondered if it was something that was falling down a hole between
> the egit team and the IDE team.
> 
> It has caught me a couple of times, and it looks like a no-brainer to pop up
> a box saying "shall I save your dirty windows now before switching branches?
> 
> How do I/you terminate this ticket - is there a "resolved - transferred to
> wishlist" 'out' ??

Not sure I understand. Each component/action must decide itself how to deal with dirty files (prevent the action, merge the content, ask to save,...). This bug here is for the Search/Replace case and I see you already filed bug 396759 for EGit problem.
Comment 4 david collier CLA 2012-12-19 11:40:54 EST
Dani - sorry - wrong bug as you so politely pointed out!