Fix visual-block delete clobbering the unnamed register - #57
Fix visual-block delete clobbering the unnamed register#57ikshantshukla123 wants to merge 3 commits into
Conversation
A block delete runs one edit per row, so re-assert the copied block after it completes. Signed-off-by: ikshantshukla123 <ikshankshukla44@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
A failing clipboard must not break the delete; it only skips the restore. Signed-off-by: ikshantshukla123 <ikshankshukla44@gmail.com>
|
Note on scope: this resolves the two writer conflict in the visual d/x path (the explicit copy wins over the per row copyon delete writes) rather than restructuring the per row notifications in DeleteBlockContext/delClip. that keeps the blast radius to vi flows the structural fix (block transactions for usage subscribers) would also touch Repeater and fits better as a follow up if you want it? @ernestrc |
|
Thanks for taking this! I gave you the green light on your approach but upon reviewing your PR, I saw an approach that avoids the need to correct the contents of the We can add a new method to type viHandler interface {
...
>> copySuppressed() bool
}Then set a boolean in viHandler that changes the return value of this new method, so while we're doing block operations in s/c visual selection, in handleVisualBlockChangeStart and d/x visual selection we don't call the underlying clipboard's Copy, preventing the clobbering. From a maintainability's point of view, I'd rather avoid an undesired behavior than amending the outcome of it. |
Suppress per-row clipboard writes so the explicit block copy is the only one that lands. Signed-off-by: ikshantshukla123 <ikshankshukla44@gmail.com>
Thanks for more clarity on requirment @ernestrc |
|
The reported workspace/explorer, startup race, OAuth EOF, and storage failover failures are addressed in follow-up #65 (with upstream OAuth fix unstablebuild/blue#3). These fixes are separate from the visual-block editing change here. Deterministic regressions and 50 repeated race-enabled runs of the affected tests pass locally; #65 CI is running. |
Visual-block
d/xfollowed byp/Preinserted only the last row ofthe block.
copySelectionForDeletewrites the full block correctly, but the deleteruns one edit per row and each edit notifies the copy-on-delete
subscriber, which overwrites the register per row. The visual
d/xpath now re-asserts the copied block once the delete completes, scoped
to block selections only. This also stops
"_don a block from touchingunnamed.
Fixes #1.
Regression test
TestVisualBlockDeleteThenPaste(full-Vilevel, wherethe subscriber is installed):
dthenP,xthenp, a raggedblock, and black-hole preservation : each checks register text, block
mode metadata, and the pasted buffer. The test fails on main with only
the last row in the register.