From 3d0bc720994a404ba316562621dd186e3efe98c5 Mon Sep 17 00:00:00 2001 From: gibbz00 Date: Sat, 3 Jun 2023 10:37:06 +0200 Subject: Place `Info::from_keymap()` contents in `keymap.infobox()`: This makes it easier later control the order in which the key events are presented. --- helix-view/src/info.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'helix-view') 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, &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() -- cgit v1.2.3-70-g09d2