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 :)
e0b89694f3Ruben Fricke committed on 1/11/2026, 8:39:42 AM· committed by GitHubparent43c252c