# editor: Fix cursor doesn’t move up and down on arrow keys when no completions are shown \(\#34678\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a7284adafab23d96330584bb0db38c85b0f171e5

Requested commit: a7284adafab23d96330584bb0db38c85b0f171e5

Commit: a7284adafab23d96330584bb0db38c85b0f171e5

Tree: 2fde8032288620b81c792c60c0a0b0eb29acdda0

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Fix cursor doesn’t move up and down on arrow keys when no completions are shown (#34678)

Closes #34338

After https://github.com/zed-industries/zed/pull/31872, to avoid
re-querying language servers, we keep the context menu around, which
stores initial query, completions items, etc., even though it may not
contain any items and hence not be rendered on screen. In this state,
up/down arrows try to switch focus in the context menu instead of
propagating it to the editor. Hence blocking buffer movement.

This PR fixes it by changing the context for `menu`,
`showing_completions`, and `showing_code_actions` to only be added when
the menu is actually being rendered (i.e., not empty).

Release Notes:

- Fix an issue where the cursor doesn’t move up and down on arrow keys
when no completions are shown.
```

## Parents

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

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