Add command names to command palette (#4071)

This commit is contained in:
nuid32 2022-10-03 19:56:43 +05:00 committed by GitHub
parent 93f26a3048
commit 576c34f84e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2427,11 +2427,11 @@ impl ui::menu::Item for MappableCommand {
match self {
MappableCommand::Typable { doc, name, .. } => match keymap.get(name as &String) {
Some(bindings) => format!("{} ({})", doc, fmt_binding(bindings)).into(),
Some(bindings) => format!("{} ({}) [{}]", doc, fmt_binding(bindings), name).into(),
None => doc.as_str().into(),
},
MappableCommand::Static { doc, name, .. } => match keymap.get(*name) {
Some(bindings) => format!("{} ({})", doc, fmt_binding(bindings)).into(),
Some(bindings) => format!("{} ({}) [{}]", doc, fmt_binding(bindings), name).into(),
None => (*doc).into(),
},
}