keymap_ui: Don't panic on KeybindSource::from_meta (#34652)

Closes #ISSUE

Log error instead of panicking when `from_meta` is passed an invalid
value

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Ben Kunkle 2025-07-17 19:03:10 -05:00 committed by GitHub
parent ed4deaa738
commit 4314b35288
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -567,7 +567,10 @@ impl KeymapEditor {
let mut string_match_candidates = Vec::new();
for key_binding in key_bindings {
let source = key_binding.meta().map(settings::KeybindSource::from_meta);
let source = key_binding
.meta()
.map(settings::KeybindSource::try_from_meta)
.and_then(|source| source.log_err());
let keystroke_text = ui::text_for_keystrokes(key_binding.keystrokes(), cx);
let ui_key_binding = Some(