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.

outline: Fix nesting issue for variable declarations (#45797)

Haojian Wu0e5b6a5f3ffa
diff --git a/crates/languages/src/cpp/outline.scm b/crates/languages/src/cpp/outline.scm
index c8973665581..e8e242ef9c2 100644
--- a/crates/languages/src/cpp/outline.scm
+++ b/crates/languages/src/cpp/outline.scm
@@ -37,7 +37,9 @@
(type_qualifier)? @context
type: (_) @context
declarator: (init_declarator
- declarator: (_) @name)) @item
+ ; The declaration may define multiple variables, using @item on the
+ ; declarator so that they get distinct ranges.
+ declarator: (_) @item @name))
(function_definition
(type_qualifier)? @context