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 47881 - Undo action remove the content of a file
Summary: Undo action remove the content of a file
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Miloslav Metelka
URL:
Keywords: REGRESSION
: 47987 48189 48589 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-25 10:08 UTC by pfelenda
Modified: 2007-11-05 13:44 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pfelenda 2004-08-25 10:08:35 UTC
dev 200408241800
Steps:
- open any java file
- use Undo (Ctrl-Z)
-> The file is empty
Comment 1 Miloslav Metelka 2004-08-25 10:16:53 UTC
I think that it's likely caused by the yesterday's integration of the
issue 47022. Reassigning to openide/editor for evaluation.
Comment 2 Petr Nejedly 2004-08-25 12:08:53 UTC
CCing Yarda, teh integrator of #47022
Comment 3 Jaroslav Tulach 2004-08-25 15:48:17 UTC
The problem does not happen with swing PlainDocument, just with
specific NetBeans document. The reasons is that we run some code in
NbDocument.runAtomic(Runnable) and at the end of runnable we attach
UndoRedoListener. The problem with NetBeans document implementation is
that at the end of the atomic action it fires changes to current
listeners even they were not registered at the time the changes were made.

I have hard time to fix it in CES, so I suggest the editor module to
reimplement this functionality to deliver events only to listeners
registered at the begining of the atomic action. I hope that will be
possible, it will definitively be more meaningful.
Comment 4 pfelenda 2004-08-26 12:48:45 UTC
*** Issue 47987 has been marked as a duplicate of this issue. ***
Comment 5 Marian Mirilovic 2004-08-26 15:23:10 UTC
Mila,
this must be fixed for NB4.0 , user can easy remove whole content of
the opened file.
Comment 6 David Konecny 2004-08-26 15:28:23 UTC
Happened to me too - was holding CTRL-Z till the end + CTRL-S +
CTRL-F4 just to later realize that my file is totally empty. Was lucky
because I could update it from CVS.
Comment 7 Miloslav Metelka 2004-08-26 15:58:41 UTC
I'm already working on the fix. I should be able to integrate it tomorrow.
Comment 8 Miloslav Metelka 2004-08-27 14:13:42 UTC
Fixed in main trunk:

Checking in libsrc/org/netbeans/editor/BaseDocument.java;
/cvs/editor/libsrc/org/netbeans/editor/BaseDocument.java,v  <-- 
BaseDocument.java
new revision: 1.108; previous revision: 1.107
Comment 9 pfelenda 2004-08-31 07:40:58 UTC
Verified in dev build 200408301800.
The Ctrl-Z is disabled after opening java file.
Comment 10 Dusan Balek 2004-08-31 08:04:12 UTC
*** Issue 48189 has been marked as a duplicate of this issue. ***
Comment 11 pfelenda 2004-09-07 14:36:54 UTC
*** Issue 48589 has been marked as a duplicate of this issue. ***