# keymap_editor: Fix deleting and editing bindings that use deprecated action names \(\#60300\) · gitcafe/zed

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

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

Visibility: public

Requested revision: bb48a42983f2a4bb9ac9d31c63abe02497088f67

Requested commit: bb48a42983f2a4bb9ac9d31c63abe02497088f67

Commit: bb48a42983f2a4bb9ac9d31c63abe02497088f67

Tree: 2d3bf4be2224ca03914d472db79ba0ce9e4f8136

Author: Ben Kunkle

Committer: GitHub

## Message

```
keymap_editor: Fix deleting and editing bindings that use deprecated action names (#60300)

# Objective

In the keymap editor, bindings whose `keymap.json` entries use a
deprecated action alias (e.g. `"editor::CopyRelativePath"` for
`workspace::CopyRelativePath`) could not be deleted or edited. Aliases
resolve to the canonical action on load, so the row displays normally,
but file updates searched for the canonical name and never matched the
alias entry. Deleting failed ("Failed to find keybinding to remove"),
and editing silently fell back to appending a new binding — leaving the
user with duplicate identical-looking rows they couldn't remove.

## Solution

- Thread gpui's deprecated-alias map
(`App::deprecated_actions_to_preferred_actions`) into
`KeymapFile::update_keybinding`, and resolve aliases in file entries
when matching bindings.
- As a side effect, editing an alias-based binding now rewrites the
entry with the canonical action name instead of duplicating it.

## Testing

- Unit tests in `settings` for removing and replacing alias-based
entries.
- End-to-end keymap editor tests (fake fs → keymap load → `KeymapEditor`
→ delete) covering both the alias case and plain duplicate bindings.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Fixed the keymap editor failing to delete or edit key bindings whose
keymap file entries use deprecated action names
```

## Parents

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

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