Make paste a separate undo transaction from preceding edits#52003
Make paste a separate undo transaction from preceding edits#52003
Conversation
dinocosta
left a comment
There was a problem hiding this comment.
Hey @Veykril, sorry for being late reviewing this! I’d gotten used to being assigned to staff PRs without having to explicitly approve them 😅
The change makes sense to me, but I’ve confirmed that the test still passes if the self.finalize_last_transaction call is commented out. Looking into this a bit, it seems related to text::History::group_interval, which is set to 0 in tests, meaning that no edits are ever grouped. As a result, it seems that we never end up, in tests, in a situation where undoing would remove both the paste and the inserted text. We probably need to call Buffer::set_group_interval with a sensible value that will actually exercise this test.
Let me know what you think. Thanks!
|
Oh thanks for double checking the test |
cfd2982 to
88fdfc9
Compare
88fdfc9 to
b88f30a
Compare
b88f30a to
8e549ee
Compare
|
/cherry-pick preview |
|
🍒💥 Cherry-pick did not succeed |
When undoing a paste, it is really confusing when that actually also removes what was type right before the paste if the paste happened fast enough after.
Release Notes: