# outline: Fix nesting in multi-name declarations in Go and C\+\+ \(\#36076\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/b564b1d5d0c07aff10ab8f351d70604220a4497f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: b564b1d5d0c07aff10ab8f351d70604220a4497f

Requested commit: b564b1d5d0c07aff10ab8f351d70604220a4497f

Commit: b564b1d5d0c07aff10ab8f351d70604220a4497f

Tree: 1a48ff8a85c3b196c3c505ca32a62f8245fd643a

Author: Michael Sloan

Committer: GitHub

## Message

```
outline: Fix nesting in multi-name declarations in Go and C++ (#36076)

An alternative might be to adjust the logic to not nest items when their
ranges are the same, but then clicking them doesn't work properly /
moving the cursor does not change which is selected. This could probably
be made to work with some extra logic there, but it seems overkill.

The downside of fixing it at the query level is that other parts of the
declaration are not inside the item range. This seems to be fine for
single line declarations - the nearest outline item is highlighted.
However, if a part of the declaration is not included in an item range
and is on its own line, then no outline item is highlighted.

Release Notes:

- Outline Panel: Fixed nesting of var and field declarations with
multiple identifiers in Go and C++

C++ before:

<img width="743" height="227" alt="image"
src="https://github.com/user-attachments/assets/af1a1d76-ecdc-4999-ae9c-95591726ccca"
/>

C++ after:

<img width="795" height="250" alt="image"
src="https://github.com/user-attachments/assets/49667ed3-e088-48b3-a9f0-6a119b5e7648"
/>

Go before:

<img width="859" height="306" alt="image"
src="https://github.com/user-attachments/assets/ecc7530a-ca16-4f37-b8d1-60687f178b12"
/>

Go after:

<img width="900" height="334" alt="image"
src="https://github.com/user-attachments/assets/d741cfb0-59e5-4d27-bd6a-f422204dc972"
/>
```

## Parents

- [48ae02c1cace50491f7e3d471a87634ddf31563d](https://git.cafe/gitcafe/zed/commit/48ae02c1cace50491f7e3d471a87634ddf31563d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/b564b1d5d0c07aff10ab8f351d70604220a4497f?format=markdown)
