https://bugzilla.wikimedia.org/show_bug.cgi?id=42222

       Web browser: ---
             Bug #: 42222
           Summary: Two replacements within the same transaction and the
                    same paragraph cause change markers to be off
           Product: VisualEditor
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: Unprioritized
         Component: Data Model
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---


Test case:

+                       'removing then inserting a character': {
+                               'calls': [
+                                       ['pushRetain', 41],
+                                       ['pushReplace', ['i'], []],
+                                       ['pushReplace', [], ['j']]
+                               ],
+                               'expected': function ( data ) {
+                                       data[41] = 'j';
+                                       ve.setProp( data[37], 'internal',
'changed', 'content', 2 );
+                               }
                        }

This sets the second change marker on data[36]. This happens because the start
offsets handled in TransactionProcessor.replace are translated using
this.adjustment , but that glosses over the fact that not all adjustments
captured in this.adjustment actually apply if the offset is before the cursor.
Instead, we need some sort of offset translation. I tried using
ve.dm.Transaction.translateOffset() but that doesn't seem to work out of the
box very well.

I guess theoretically this might also be an issue with other uses of .start
attributes in the replacement processor, but it hasn't led to issues so far.

Low prio because we currently don't generate transactions that trigger this
case.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to