helix: Fix line selection after undoing delete (#55365)

Closes #55170

Fixes Helix mode undo selection history after `d` deletes the character
under an empty cursor. Previously, `d` temporarily expanded the cursor
to a one-character selection before deleting, and undo restored that
temporary selection. When the deleted character was a newline, pressing
`x` after undo selected additional line which was wrong.

This preserves the original Helix selection as the undo-restored
selection while keeping the existing delete behavior unchanged.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed Helix mode selecting one extra line after undoing a newline
delete

Co-authored-by: Tom Houlé <13155277+tomhoule@users.noreply.github.com>
befa775029Mikhail Pertsev committed on 6/5/2026, 4:50:02 PM· committed by GitHubparentb762980
3 files changedLine totals unavailable