diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 7e4969c1a7fb..fd5ea7188dc2 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -54,7 +54,7 @@ use crate::{ use crate::job::{self, Jobs}; use futures_util::StreamExt; -use std::{collections::HashMap, fmt, fmt::Write, future::Future}; +use std::{collections::HashMap, fmt, future::Future}; use std::{collections::HashSet, num::NonZeroUsize}; use std::{ @@ -2431,13 +2431,11 @@ impl ui::menu::Item for MappableCommand { let fmt_binding = |bindings: &Vec>| -> String { bindings.iter().fold(String::new(), |mut acc, bind| { if !acc.is_empty() { - acc.push_str(", "); + acc.push(' '); + } + for key in bind { + acc.push_str(&key.key_sequence_format()); } - bind.iter().fold(false, |needs_plus, key| { - write!(&mut acc, "{}{}", if needs_plus { "+" } else { "" }, key) - .expect("Writing to a string can only fail on an Out-Of-Memory error"); - true - }); acc }) };