This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 172985 - "Save as" should never clear the Undo list
Summary: "Save as" should never clear the Undo list
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker with 1 vote (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-24 11:14 UTC by hergo333
Modified: 2012-10-26 12:37 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hergo333 2009-09-24 11:14:02 UTC
How to reproduce:
- open an existing file (for instance, test.php)
- edit the file
- save it as 'test2.php'
- try to undo changes

Undo will not work anymore because the file is reopened. This is unintuitive and unexpected from users' point of view
and has just caused a loss of some precious code in my case (no, unfortunately it was not in SVN yet :( ).

I agree Undo should not be relied upon, but if you are editing a file and discover that you will need the old version as
well as new, then you need a way to get both of the versions. In all IDEs I have used the way out is Save As + Undo -
but not in NetBeans. 

I am not sure this is the correct place to report this (too many categories) - if not, please move to correct place.
Comment 1 Victor Vasilyev 2009-09-28 03:08:28 UTC
This issue is about the Undo actions that are accessible for a file opened in the editor.
Please, reassign it to a correct component. (May be it is editor/code?)

Proposed scenario can be considered as valid:
* An Undo actions stack for a file should be accessible for a user during a session, i.e. until restart of the IDE.
* The actions like as "Save" ans "Save As..." should not clear the Undo actions stack.
* In case of  "Save As...", the Undo actions stack of old file should be reassigned to a newly created and re-opened file.
Comment 2 Andrei Chistiakov 2009-09-29 15:23:16 UTC
Reassigning to editor, not sure though.
Comment 3 mslama 2009-10-02 12:39:09 UTC
I will check what happens but I am afraid it is be design ie. current behavior is given by design. I assume new document
is created.
Comment 4 hergo333 2009-10-19 12:55:45 UTC
Even if a new document is created the Undo stack should be assigned to it. From user's point of view I see no reason not
to do that.

If this is not a viable solution, the user should at least be notified that saving under a new name will lose the undo
stack (but this is an ugly solution - marking the trap instead of removing it :).

I probably won't fall in the same trap because I have learned to avoid it (it took me a few hours to rewrite the code
again), but it makes "Save as" much less usable (to me at least). 
Comment 5 David Strupl 2012-10-25 13:39:35 UTC
Bug prior to 7.0, not touched for the last 2 years --> P4.