Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix indentations for expressions in C/C++ (#58740)

Helmer Nordström308a1067ec88
diff --git a/crates/grammars/src/c/indents.scm b/crates/grammars/src/c/indents.scm
index 0b55631e5ca..41f3c4fd3d4 100644
--- a/crates/grammars/src/c/indents.scm
+++ b/crates/grammars/src/c/indents.scm
@@ -9,6 +9,10 @@
(else_clause)
] @indent
+(expression_statement
+ (_) @indent
+ ";" @end)
+
(_
"{"
"}" @end) @indent
diff --git a/crates/grammars/src/cpp/indents.scm b/crates/grammars/src/cpp/indents.scm
index ebd5afb7c74..d8c71736e9d 100644
--- a/crates/grammars/src/cpp/indents.scm
+++ b/crates/grammars/src/cpp/indents.scm
@@ -9,6 +9,10 @@
(else_clause)
] @indent
+(expression_statement
+ (_) @indent
+ ";" @end)
+
(_
"{"
"}" @end) @indent