aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/info.rs4
-rw-r--r--helix-view/src/input.rs2
-rw-r--r--helix-view/src/keyboard.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/helix-view/src/info.rs b/helix-view/src/info.rs
index 629a3112..b5a002fa 100644
--- a/helix-view/src/info.rs
+++ b/helix-view/src/info.rs
@@ -1,6 +1,6 @@
use crate::input::KeyEvent;
use helix_core::unicode::width::UnicodeWidthStr;
-use std::fmt::Write;
+use std::{collections::BTreeSet, fmt::Write};
#[derive(Debug)]
/// Info box used in editor. Rendering logic will be in other crate.
@@ -16,7 +16,7 @@ pub struct Info {
}
impl Info {
- pub fn new(title: &str, body: Vec<(&str, Vec<KeyEvent>)>) -> Info {
+ pub fn new(title: &str, body: Vec<(&str, BTreeSet<KeyEvent>)>) -> Info {
let body = body
.into_iter()
.map(|(desc, events)| {
diff --git a/helix-view/src/input.rs b/helix-view/src/input.rs
index 1e0ddfe2..580204cc 100644
--- a/helix-view/src/input.rs
+++ b/helix-view/src/input.rs
@@ -8,7 +8,7 @@ use crate::keyboard::{KeyCode, KeyModifiers};
/// Represents a key event.
// We use a newtype here because we want to customize Deserialize and Display.
-#[derive(Debug, PartialEq, Eq, PartialOrd, Clone, Copy, Hash)]
+#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
pub struct KeyEvent {
pub code: KeyCode,
pub modifiers: KeyModifiers,
diff --git a/helix-view/src/keyboard.rs b/helix-view/src/keyboard.rs
index 26a4d6d2..810aa063 100644
--- a/helix-view/src/keyboard.rs
+++ b/helix-view/src/keyboard.rs
@@ -54,7 +54,7 @@ impl From<crossterm::event::KeyModifiers> for KeyModifiers {
}
/// Represents a key.
-#[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)]
+#[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum KeyCode {
/// Backspace key.