# Fix panic when \`editor::OpenSelectionsInMultibuffer\` only has pending selection \(\#32842\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2f3acb618528d3e2bcc1bced42c767ca2ce41a4c

Requested commit: 2f3acb618528d3e2bcc1bced42c767ca2ce41a4c

Commit: 2f3acb618528d3e2bcc1bced42c767ca2ce41a4c

Tree: b879ce36214c57b1039ce2bde6bc3fe88df1b71e

Author: Michael Sloan

Committer: GitHub

## Message

```
Fix panic when `editor::OpenSelectionsInMultibuffer` only has pending selection (#32842)

On the panics dashboard, saw this panic of `There must be at least one
selection` in `open_locations_in_multibuffer`. Only seems to have
happened once in the past month.

Fix is to include the pending selection. Since `selections.all()` cannot
provide anchor selections, added `selections.all_anchors()` which only
really does any work if there is a pending selection.

Also fixes a corner case in jump-to-definitions where if the definition
is `HoverLink::InlayHint` and the `compute_target_location` fails for
all definitions it could potentially also trigger this case (and return
`Navigated::Yes` instead of `Navigated::No`

Release Notes:

- N/A
```

## Parents

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

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