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.

Support union declarations in C/C++ textobjects.scm (#45308)

Haojian Wu895213a94def
diff --git a/crates/languages/src/c/textobjects.scm b/crates/languages/src/c/textobjects.scm
index 832dd62288b..e29f508b701 100644
--- a/crates/languages/src/c/textobjects.scm
+++ b/crates/languages/src/c/textobjects.scm
@@ -23,3 +23,9 @@
"{"
[(_) ","?]* @class.inside
"}")) @class.around
+
+(union_specifier
+ body: (_
+ "{"
+ (_)* @class.inside
+ "}")) @class.around
diff --git a/crates/languages/src/cpp/textobjects.scm b/crates/languages/src/cpp/textobjects.scm
index 11a27b8d581..027185a0cfa 100644
--- a/crates/languages/src/cpp/textobjects.scm
+++ b/crates/languages/src/cpp/textobjects.scm
@@ -24,6 +24,12 @@
[(_) ","?]* @class.inside
"}")) @class.around
+(union_specifier
+ body: (_
+ "{"
+ (_)* @class.inside
+ "}")) @class.around
+
(class_specifier
body: (_
"{"