# Fix cmd\+click find all references fallback not working in Vim mode \(\#10684\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 21022f16440cd585b1f98720777a98ce9e706678

Requested commit: 21022f16440cd585b1f98720777a98ce9e706678

Commit: 21022f16440cd585b1f98720777a98ce9e706678

Tree: d4c7c3263c86737f341918669be48202107048db

Author: Congyu

Committer: GitHub

## Message

```
Fix cmd+click find all references fallback not working in Vim mode (#10684)

Exclude go-to-definition links returned by LSP that points to the
current cursor position. This fixes #10392 . Related PR #9243 .

The previous implementation first performs go-to-definition, and if the
selected text covers the clicked position, it figures out that it is
already clicking on a definition, and should instead look for
references.

However, the selected range does not necessarily cover the clicked
position after clicking on a definition, as in VIM mode.

After the PR, if cmd+click on definitions, the definition links would be
an empty list, so no go-to-definition is performed, and
find-all-references is performed instead.

Release Notes:

- Fixed #10392 , now `cmd+click`ing to find all references works in vim
mode.
```

## Parents

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

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