javalover520 / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Undo compound manager is broken since revision r121 #130

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open document tester
2. Type some text on several lines
3. Type "abc" in the middle of first line
4. Type "xyz" in the middle of second line
5. Type Control-Z to undo

What is the expected output?
Undo should remove the "xyz" entry

What do you see instead?
All the entered text is removed

What version of the product are you using? On what operating system?
0.9.5-b29

Please provide any additional information below.
r121 change:
-       if (startCombine || offsetChange == lengthChange && 
Math.abs(offsetChange) == 1) {
+       if (startCombine || Math.abs(docEvt.getLength()) == 1) {
            compoundEdit.addEdit(e.getEdit());
-           lastOffset = docEvt.getOffset();
-           lastLength = doc.getLength();
            startCombine = false;
            return;
        }
=> So every change which is a single character is added to the current 
compound edit, without taking the location into account !

Original issue reported on code.google.com by david.e...@gmail.com on 26 Jan 2010 at 9:54

GoogleCodeExporter commented 8 years ago
Problem verified.  Fix will be tested.

Thanks for the report.

Original comment by ayman.al...@gmail.com on 8 Feb 2010 at 6:36

GoogleCodeExporter commented 8 years ago
fixed in r124

Original comment by ayman.al...@gmail.com on 8 Feb 2010 at 7:24