Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 11122

Summary: Please don't prompt to save when re-using editors
Product: [Eclipse Project] Platform Reporter: Peter Burka <peter_burka>
Component: UIAssignee: Karen Williamson <Karen_Williamson>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: dpwegener, hudsonr, sja.eclipse
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Peter Burka CLA 2002-03-11 15:26:24 EST
If you have a dirty file in an editor, and you open a new file, Eclipse will 
prompt you with

'foo.java has been modified. Save changes?
[Yes] [No] [Open New Editor]'

This is particularly annoying because it asks you about the same editor over 
and over again.

I would prefer if it always just opened a new editor.  I like to avoid editor 
prolifieration, but in this case it seems a bit too eager to discard editors.

 - it's one less dialog I have to read, comprehend and respond to
 - fewer dialogs means smoother workflow
 - if you poll people, I suspect that you'll find that 'Open new editor' is the 
right answer 95% of the time
 - the risk of harm is non-existant (i.e. opening a new editor can't really 
hurt anything)
 - it's one less string to externalize

(20020214 build)
Comment 1 David Wegener CLA 2002-08-21 14:12:33 EDT
Speaking for the remaining 5%, I would request that this be made a preference.  
I don't want the number of open editors to exceede  my max editor setting.  I 
prefer to keep the count set to a value that prevents the name scrunching and 
the addition of the arrow tabs.  I often find my self bouncing back and forth 
between a few files.  If editors continue to get opened, you need to spend time 
hovering the mouse over tabs to read the name or scrolling back and forth with 
the little arrow keys.  I am willing to deal with the additional dialogs in 
order to make navigation between files easier.
Comment 2 Randy Hudson CLA 2002-08-21 14:33:40 EDT
*** Bug 16586 has been marked as a duplicate of this bug. ***
Comment 3 Karen Williamson CLA 2002-10-08 11:30:50 EDT
Fix released to HEAD stream (WorkbenchPlugin, EditorsPreferencePage, 
IPreferenceConstants, EditorManager and message.properties)
Comment 4 Simon Archer CLA 2002-10-16 20:07:24 EDT
How about this for an idea: When you open a new file and the oldest editor is 
dirty, why not skip it and try the next oldest editor, and so on, until a non-
dirty editor is found?

This way the only time you'd get asked to save the contents of an editor would 
be when ALL your editors are dirty.  And I suppose the dialog could say:

'foo.java has been modified. Save changes?
[Save] [Save All] [No] [Open New Editor]'


The addition of the [Save All] button would reduce the chance of seeing the 
dialog again, which sounds like a great idea.
Comment 5 Randy Hudson CLA 2002-10-24 09:48:22 EDT
I *never* want to be prompted if I have a dirty editor open.  Ignore the dirty 
editor completely.  There is a reason it is dirty, maybe I am manually 
refactoring code (i.e. cut/past), and I am opening subclasses to pull-up 
methods.
Comment 6 Randy Hudson CLA 2002-10-24 09:49:42 EDT
Sorry, that last comment was about Simon's previous comment.  It seems this bug 
is marked fixed, but I was not commenting about the fix.  I have not yet 
downloaded 2.1 to see how this bug was fixed.
Comment 7 Karen Williamson CLA 2002-10-24 10:32:24 EDT
The current method by which a replacement editor is chosen is to find the 
oldest non-dirty, non-pinned editor.  Only if all the editors are either dirty 
or pinned, then

1) a prompt be shown, or 
2) a new editor will be opened.

Whether (1) or (2) happens will depend on the preferences the user has set.
The addition of a [Save all] button will be taken under consideration.