# Fix stale pending keybinding indicators on focus change \(\#44678\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f084e20c56afec3c823a743e3278eade9515f2dd

Requested commit: f084e20c56afec3c823a743e3278eade9515f2dd

Commit: f084e20c56afec3c823a743e3278eade9515f2dd

Tree: ef203d9aee98c021f42692673fe53d20177ae1f0

Author: Xipeng Jin

Committer: GitHub

## Message

```
Fix stale pending keybinding indicators on focus change (#44678)

Closes #ISSUE

Problem:

- The status bar’s pending keystroke indicator (shown next to --NORMAL--
in Vim mode) didn’t clear when focus moved to another context, e.g.
hitting g in the editor then clicking the Git panel. The keymap state
correctly canceled the prefix, but observers that render the indicator
never received a “pending input changed” notification, so the UI kept
showing stale prefixes until a new keystroke occurred.

Fix:

- The change introduces a `pending_input_changed_queued` flag and a new
helper `notify_pending_input_if_needed` which will flushes the queued
notification as soon as we have an App context. The
`pending_input_changed` now resets the flag after notifying subscribers.

Before:


https://github.com/user-attachments/assets/7bec4c34-acbf-42bd-b0d1-88df5ff099aa

After:



https://github.com/user-attachments/assets/2264dc93-3405-4d63-ad8f-50ada6733ae7



Release Notes:

- Fixed: pending keybinding prefixes on the status bar now clear
immediately when focus moves to another panel or UI context.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
```

## Parents

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

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