# Unify behavior of delete/cut to line boundary actions \(\#59627\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/af3f79076274fcbab3d53f93d14e9da6e8d2736c)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: af3f79076274fcbab3d53f93d14e9da6e8d2736c

Requested commit: af3f79076274fcbab3d53f93d14e9da6e8d2736c

Commit: af3f79076274fcbab3d53f93d14e9da6e8d2736c

Tree: 556edbcbe19f04afa9cced22baa371e8a088fae7

Author: Joseph T\. Lyons

Committer: GitHub

## Message

```
Unify behavior of delete/cut to line boundary actions (#59627)

I noticed that our line deletion actions are inconsistent.

For `DeleteToBeginningOfLine`:

- `one «two threeˇ» four` -> ` four` ✅
- `one «ˇtwo three» four` -> ` four` ✅

Great, these have the same results, regardless of selection direction.

For `DeleteToEndOfLine`:

- `one «two threeˇ» four` -> ` one ` ✅
- `one «ˇtwo three» four` -> `one two three` ❌

Whoops, that second one should be the same, assuming that selection
direction again shouldn't matter, as in the case of
`DeleteToBeginningOfLine`.

The same issue exists for `CutToEndOfLine`:

- `The quick «brownˇ» fox` -> `The quick ` ✅
- `The quick «ˇbrown» fox` -> `The quick brown` ❌

I unified the end-of-line actions to match `DeleteToBeginningOfLine`:
selection direction no longer matters, so the whole selection is always
included.

---

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

Release Notes:

- Fixed `editor: delete to end of line` to behave consistently
regardless of selection direction.
- Fixed `editor: cut to end of line` to behave consistently regardless
of selection direction.
```

## Parents

- [1fd93cbd3460dbd1c112874936055e18ff1111b7](https://git.cafe/gitcafe/zed/commit/1fd93cbd3460dbd1c112874936055e18ff1111b7?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/af3f79076274fcbab3d53f93d14e9da6e8d2736c?format=markdown)
