The fix for bug 150251 uses BEGIN/END_COMMIT_GROUP. It uncovered an issue with nesting empty commit-groups; see bug 150251 comment 5 for details. The attached patch clarifies, and fixes, an incompletely defined situation; MARK_COMMIT_GROUP is added to the API to fill the gap. Tests are added.
The behavior when a nested empty begin/end is different, they are now ignored. Since UndoGroupManager is new and hardly used, I didn't flag this as a semantic change; if you want this flagged as a change, I'll need details on how/where to describe it. Note that with this change, the old tests all still pass.
Created attachment 109007 [details]
as described in bug summary
I'm unclear about procedure to get this patch considered. I know there are various keyword and whiteboard flags. Someone please advise?
IMO, it is low risk and should only affect things when jVi is active. Can it get considered for 701?
(In reply to comment #2)
> I'm unclear about procedure to get this patch considered. I know there are
> various keyword and whiteboard flags. Someone please advise?
Looks OK as far as that goes. (I am not knowledgeable enough to comment on the actual content of the patch.)
> it is low risk
Anything making several logic changes to such a critical class as CloneableEditorSupport cannot be considered low risk.
> Can it get considered for 701?
7.0.1 is in high resistance, accepting only priority bug fixes <http://wiki.netbeans.org/NB701HighResistance>, so I do not think so.
(In reply to comment #3)
> (In reply to comment #2)
> > it is low risk
> Anything making several logic changes to such a critical class as
> CloneableEditorSupport cannot be considered low risk.
Sigh. Guess I should have originally put the UndoGroupManager class in a separate file package private rather than a nested static class ;-)
> > Can it get considered for 701?
> 7.0.1 is in high resistance, accepting only priority bug fixes
> <http://wiki.netbeans.org/NB701HighResistance>, so I do not think so.
"Timing is everything". At least now I know how to build an nbm with a patch in it.
Created attachment 109114 [details]
updated to include fix for bug 199699
Updated patch with fix for bug 199699. The control edits BEGIN/END_COMMIT_GROUP always return true for canUndo/canRedo.
Bug 199700 is another undo issue with properties editor. The changes in this patch are not in conflict with any fix for that.
I believe the right fix for that is to first move UndoGroupManager into UndoRedo.Manager as discussed in that issue. A fix for that could be incorporated into this patch. For policy and procedural reasons, handling them separately may be preferred.
Re-assigning after review period.
I urge you to consider this.
After commit, this and Bug 199700 can be resolved.
Integrated as ergonomics#971cca9637b5
(In reply to comment #7)
> After commit, this and Bug 199700 can be resolved.
Oops, it is 199699 to relolve. I am doing that now
Integrated into 'main-golden', will be available in build *201107190600* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Log: #199568: Define empty begin/end COMMIT_GROUP behavior, add MARK_COMMIT_GROUP