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 150426 - Cursor position after Undo is wrong
Summary: Cursor position after Undo is wrong
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 18:10 UTC by Mikhail Matveev
Modified: 2009-11-02 11:03 UTC (History)
0 users

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 Mikhail Matveev 2008-10-16 18:10:29 UTC
Type text:

abc

Place cursor after a.
Press Del.
Press Ctrl-Z (Undo).

Result: Undo performed correctly, but cursor position is changed: it's now after b. It's wrong. At least it's not as in
most of standard text editors.
Comment 1 Vitezslav Stejskal 2008-10-20 12:20:45 UTC
Well, I think this behavior is intentional. Although I agree that people are likely to have different preferences over
this and what you request is definitely a valid behavior. 


> At least it's not as in most of standard text editors.

Maybe. I tried Eclipse and it behaves the same as Netbeans (plus it selects the text that the undo action placed back to
the document, which btw looks like a nice little feature). I also tried gedit and it behaves the way that you described.
So, I think it's really hard to say what is correct or better.
Comment 2 Miloslav Metelka 2008-11-14 11:19:52 UTC
There is a technical problem that currently the undo queue only stores model modifications not the view's changes i.e.
it only stores document mutations but not caret movements at all (you can see the same behavior if you run swing's demos
Notepad.jar). This would have to be designed and changed e.g. store initial and target caret offset (not direct
references to caret etc.) so that undo/redo would work properly.
Marking for later.
Comment 3 Quality Engineering 2009-11-02 11:03:10 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX