diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index b9e0ec1d0..973786d53 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -102,7 +102,15 @@ pub fn infobox(&self) -> Info { .position(|&k| k == *keys.iter().next().unwrap()) .unwrap() }); - Info::from_keymap(self.name(), body) + + let body: Vec<_> = body + .into_iter() + .map(|(events, desc)| { + let events = events.iter().map(ToString::to_string).collect::>(); + (events.join(", "), desc) + }) + .collect(); + Info::new(self.name(), &body) } } diff --git a/helix-view/src/info.rs b/helix-view/src/info.rs index eced78e10..1503e855e 100644 --- a/helix-view/src/info.rs +++ b/helix-view/src/info.rs @@ -1,6 +1,5 @@ -use crate::input::KeyEvent; use helix_core::{register::Registers, unicode::width::UnicodeWidthStr}; -use std::{collections::BTreeSet, fmt::Write}; +use std::fmt::Write; #[derive(Debug)] /// Info box used in editor. Rendering logic will be in other crate. @@ -55,18 +54,6 @@ pub fn new(title: &str, body: &[(T, U)]) -> Self } } - pub fn from_keymap(title: &str, body: Vec<(BTreeSet, &str)>) -> Self { - let body: Vec<_> = body - .into_iter() - .map(|(events, desc)| { - let events = events.iter().map(ToString::to_string).collect::>(); - (events.join(", "), desc) - }) - .collect(); - - Self::new(title, &body) - } - pub fn from_registers(registers: &Registers) -> Self { let body: Vec<_> = registers .inner()