Repository navigation
Conversation
Merging forward from an empty block removed it selecting the previous block, jumping the caret backward to its end. The first block of a merge only holds the selection when merging forward, so removing it must select the second block at its start, letting repeated presses keep deleting forward. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GQNdFF1FUU9JXfNGZev2na
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GQNdFF1FUU9JXfNGZev2na
|
Size Change: +15 B (0%) Total Size: 7.75 MB 📦 View Changed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes #64235. Pressing forward delete in an empty block removes it and places the caret at the start of the next block, so repeated presses keep deleting forward. Previously the caret jumped backward to the end of the previous block.
Why?
mergeBlocksremoved the unmodified first block with select-previous semantics. That is the one branch where the removed block itself holds the selection (a forward merge from an empty block), so the selection fell back to the block before it, against the direction of the gesture.How?
When the removed first block was the selected one, select the second block at its start instead. The backward merge paths are untouched: there the removed block does not hold the selection, and their behavior is already correct.
Testing Instructions
Covered by an e2e test in all three engines; it fails on trunk.
Use of AI Tools
Written with Claude Code, reviewed and tested by me.