Add AutoIndent action and '=' vim operator (#21427)

Release Notes:

- vim: Added the `=` operator, for auto-indent

Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Max Brunsfeld
2024-12-02 15:00:04 -08:00
committed by GitHub
co-authored by Conrad
parent f3140f54d8
commit 7c994cd4a5
13 changed files with 481 additions and 186 deletions
+6
View File
@@ -170,6 +170,9 @@ impl Vim {
Some(Operator::Indent) => self.indent_motion(motion, times, IndentDirection::In, cx),
Some(Operator::Rewrap) => self.rewrap_motion(motion, times, cx),
Some(Operator::Outdent) => self.indent_motion(motion, times, IndentDirection::Out, cx),
Some(Operator::AutoIndent) => {
self.indent_motion(motion, times, IndentDirection::Auto, cx)
}
Some(Operator::Lowercase) => {
self.change_case_motion(motion, times, CaseTarget::Lowercase, cx)
}
@@ -202,6 +205,9 @@ impl Vim {
Some(Operator::Outdent) => {
self.indent_object(object, around, IndentDirection::Out, cx)
}
Some(Operator::AutoIndent) => {
self.indent_object(object, around, IndentDirection::Auto, cx)
}
Some(Operator::Rewrap) => self.rewrap_object(object, around, cx),
Some(Operator::Lowercase) => {
self.change_case_object(object, around, CaseTarget::Lowercase, cx)