diff options
author | gibbz00 | 2023-06-03 08:37:06 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2023-06-07 01:11:13 +0000 |
commit | 3d0bc720994a404ba316562621dd186e3efe98c5 (patch) | |
tree | ec26b12d749d7b658e509e3332f878b212f36307 /helix-view/src | |
parent | 19326d23d15f5e7a1df61249d071e835a28905ed (diff) |
Place `Info::from_keymap()` contents in `keymap.infobox()`:
This makes it easier later control the order in which the key events
are presented.
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/info.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/helix-view/src/info.rs b/helix-view/src/info.rs index eced78e1..1503e855 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 @@ impl Info { } } - pub fn from_keymap(title: &str, body: Vec<(BTreeSet<KeyEvent>, &str)>) -> Self { - let body: Vec<_> = body - .into_iter() - .map(|(events, desc)| { - let events = events.iter().map(ToString::to_string).collect::<Vec<_>>(); - (events.join(", "), desc) - }) - .collect(); - - Self::new(title, &body) - } - pub fn from_registers(registers: &Registers) -> Self { let body: Vec<_> = registers .inner() |