Add stop_at_indent for MoveToBeginningOfLine (#25428)
Add support for `stop_at_indent` option for MoveToBeginningOfLine and SelectToBeginningOfLine instead of mixing that with `stop_at_soft_wraps`. Add emacs mapping for `alt-m` (`back-to-indentation`)
This commit is contained in:
@@ -9371,7 +9371,12 @@ impl Editor {
|
||||
self.change_selections(Some(Autoscroll::fit()), window, cx, |s| {
|
||||
s.move_cursors_with(|map, head, _| {
|
||||
(
|
||||
movement::indented_line_beginning(map, head, action.stop_at_soft_wraps),
|
||||
movement::indented_line_beginning(
|
||||
map,
|
||||
head,
|
||||
action.stop_at_soft_wraps,
|
||||
action.stop_at_indent,
|
||||
),
|
||||
SelectionGoal::None,
|
||||
)
|
||||
});
|
||||
@@ -9387,7 +9392,12 @@ impl Editor {
|
||||
self.change_selections(Some(Autoscroll::fit()), window, cx, |s| {
|
||||
s.move_heads_with(|map, head, _| {
|
||||
(
|
||||
movement::indented_line_beginning(map, head, action.stop_at_soft_wraps),
|
||||
movement::indented_line_beginning(
|
||||
map,
|
||||
head,
|
||||
action.stop_at_soft_wraps,
|
||||
action.stop_at_indent,
|
||||
),
|
||||
SelectionGoal::None,
|
||||
)
|
||||
});
|
||||
@@ -9410,6 +9420,7 @@ impl Editor {
|
||||
this.select_to_beginning_of_line(
|
||||
&SelectToBeginningOfLine {
|
||||
stop_at_soft_wraps: false,
|
||||
stop_at_indent: false,
|
||||
},
|
||||
window,
|
||||
cx,
|
||||
|
||||
Reference in New Issue
Block a user