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 183695

Summary: NetBeans doesn't return selection on undo
Product: editor Reporter: Ivan Sidorkin <ivansidorkin>
Component: Actions/Menu/ToolbarAssignee: Miloslav Metelka <mmetelka>
Status: RESOLVED FIXED    
Severity: normal CC: bobw, nigel_bris, nnnnnk, ralphbenjamin
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Ivan Sidorkin 2010-04-08 09:43:35 UTC
select some code
delete it
do undo
NetBeans doesn't return selection on undo
Comment 1 Miloslav Metelka 2010-04-08 13:15:05 UTC
I know it's off-topic from user's point of view but with Swing's MVC this is not straightforward to implement this request since UndoManager is per-Document which is correct but caret position/selection is a view-related info. If there would be more views per one document each of them can have a different selection.
A solution would be to have an Undo/Redo API that would allow to associate caret-related information (with a weak-ref to the text component) to the undoable item of the modification.
Comment 2 Vitezslav Stejskal 2010-04-19 20:39:15 UTC
*** Bug 159016 has been marked as a duplicate of this bug. ***
Comment 3 Vitezslav Stejskal 2010-06-14 06:41:48 UTC
*** Bug 187495 has been marked as a duplicate of this bug. ***
Comment 4 dalton1130 2016-06-24 15:19:42 UTC
Is there any chance that this enhancement ever happens? I would love for it to be a thing
Comment 5 Ralph Ruijs 2016-06-24 20:54:20 UTC
Mila, are we able to implement this now that we have EditorCaretUndo?
Comment 6 Miloslav Metelka 2016-06-27 08:31:44 UTC
I've tested it in a recent dev build and selection restoration works both after deletion by backspace and delete keys.
Comment 7 dalton1130 2016-06-27 13:53:29 UTC
That's awesome. Any time table on when this could be released?
Comment 8 Ralph Ruijs 2016-06-28 07:44:37 UTC
(In reply to dalton1130 from comment #7)
> That's awesome. Any time table on when this could be released?

The nightly build is available from the download page[1]. The NetBeans 8.2 wiki[2] shows the latest info on the release.


[1] - http://bits.netbeans.org/download/trunk/nightly/latest/
[2] - http://wiki.netbeans.org/NetBeans_82