Add stop_at_indent for Editor::DeleteToBeginningOfLine (#25688)

Added test_beginning_of_line_stop_at_indent editor test

- Follow-up to: https://github.com/zed-industries/zed/pull/25428
- Replaces: https://github.com/zed-industries/zed/pull/25346

This is all authored by @felixpackard in #25346
I just updated it to use `stop_at_indent` instead of
`stop_at_first_char`.

Release Notes:

- Added support for `stop_at_indent` to
`Editor::DeleteToBeginningOfLine` (thanks
[@felixpackard](https://github.com/felixpackard))

Co-authored-by: Felix Packard <felix@rigr.gg>
This commit is contained in:
Peter Tripp 2025-03-01 11:03:47 -05:00 committed by GitHub
parent d115cb1944
commit aa1ab50656
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 123 additions and 5 deletions

View file

@ -35,6 +35,13 @@ pub struct SelectToBeginningOfLine {
pub stop_at_indent: bool,
}
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema)]
#[serde(deny_unknown_fields)]
pub struct DeleteToBeginningOfLine {
#[serde(default)]
pub(super) stop_at_indent: bool,
}
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema)]
#[serde(deny_unknown_fields)]
pub struct MovePageUp {
@ -226,6 +233,7 @@ impl_actions!(
ComposeCompletion,
ConfirmCodeAction,
ConfirmCompletion,
DeleteToBeginningOfLine,
DeleteToNextWordEnd,
DeleteToPreviousWordStart,
ExpandExcerpts,
@ -292,7 +300,6 @@ gpui::actions!(
CutToEndOfLine,
Delete,
DeleteLine,
DeleteToBeginningOfLine,
DeleteToEndOfLine,
DeleteToNextSubwordEnd,
DeleteToPreviousSubwordStart,