# editor: Fix DeleteToPreviousSubwordStart and DeleteToNextSubwordEnd interaction with newlines \(\#46235\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e0b89694f36dc8a85ded2b18f3268688559ff655

Requested commit: e0b89694f36dc8a85ded2b18f3268688559ff655

Commit: e0b89694f36dc8a85ded2b18f3268688559ff655

Tree: e28eeeb32f63df125557984e024e62751b3f73bb

Author: Ruben Fricke

Committer: GitHub

## Message

```
editor: Fix DeleteToPreviousSubwordStart and DeleteToNextSubwordEnd interaction with newlines  (#46235)

Closes #40110

  Changes:
- `DeleteToPreviousSubwordStart` now deletes `\n` separately from
preceding subwords and whitespace.
- `DeleteToNextSubwordEnd` now deletes `\n` and any following whitespace
separately from subsequent subwords.
- Added an `ignore_newlines` flag to both actions to optionally retain
the old behavior.

These modifications align the subword commands with their word
counterparts and with other popular editors like VSCode and Sublime.

Related to: https://github.com/zed-industries/zed/pull/16848

  Release Notes:

- Improved `DeleteToPreviousSubwordStart` and `DeleteToNextSubwordEnd`
interactions around newlines. You can opt-in into the previous behavior
by adding `{"ignore_newlines": true}` to either action's binds in your
keymap.

  ---

This is my first contribution to Zed! If anything should be done
differently, please let me know. Happy to learn :)
```

## Parents

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

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