Introduce new way of replace text for child of TransformString operators.
When replaceByDiff props is set to true, replace text by diffing old and new text.
false: existing behavior, just replace old to new text
true: by diffing, replace minimum amount of ranges to leach to new text
Pros
Cleaner undo/redo highlight
Cursor is not includes to mutated range, so staying at same position is more accurate, can further be improved in another PR.
Cons
Old to new replace is broken into multiple patch, confusing?
When delete-surround on off-screen surround, user doesn't see flash highlight since highlight decoration happens very small range of text which is off-screen(This is big disadvantage).
Which operators use this new mechanism
Surround family: enabled by replaceByDiffOnSurround config(default false)
Introduce new way of replace text for child of
TransformString
operators.When
replaceByDiff
props is set totrue
, replace text by diffing old and new text.false
: existing behavior, just replace old to new texttrue
: by diffing, replace minimum amount of ranges to leach to new textPros
Cons
Which operators use this new mechanism
replaceByDiffOnSurround
config(defaultfalse
)g |
): enabled statically.