summaryrefslogtreecommitdiffstats
path: root/src/verb
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2023-03-16 20:39:25 +0100
committerCanop <cano.petrole@gmail.com>2023-03-16 20:39:25 +0100
commit56118492de50a0a972e905588d65ef23b108de91 (patch)
treea830efec5d6700a4f92fa78bba2befcbe0e0671a /src/verb
parente18ed9f8815e237d997e2f7de99536e4c51e3929 (diff)
don't show modal only key in help if modal disabled
Diffstat (limited to 'src/verb')
-rw-r--r--src/verb/verb.rs15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/verb/verb.rs b/src/verb/verb.rs
index 55aba13..f3de14c 100644
--- a/src/verb/verb.rs
+++ b/src/verb/verb.rs
@@ -3,7 +3,6 @@ use {
crate::{
app::*,
errors::ConfError,
- keys::KEY_FORMAT,
path::PathAnchor,
},
crokey::crossterm::event::KeyEvent,
@@ -39,9 +38,6 @@ pub struct Verb {
/// key shortcuts
pub keys: Vec<KeyEvent>,
- /// description of the optional keyboard key(s) triggering that verb
- pub keys_desc: String,
-
/// how the input must be checked and interpreted
/// Can be empty if the verb is only called with a key shortcut.
pub invocation_parser: Option<InvocationParser>,
@@ -114,7 +110,6 @@ impl Verb {
Ok(Self {
names,
keys: Vec::new(),
- keys_desc: "".to_string(),
invocation_parser,
execution,
description,
@@ -127,24 +122,14 @@ impl Verb {
panels: Vec::new(),
})
}
- fn update_key_desc(&mut self) {
- self.keys_desc = self
- .keys
- .iter()
- .map(|&k| KEY_FORMAT.to_string(k))
- .collect::<Vec<String>>() // no way to join an iterator today ?
- .join(", ");
- }
pub fn with_key(mut self, key: KeyEvent) -> Self {
self.keys.push(key);
- self.update_key_desc();
self
}
pub fn add_keys(&mut self, keys: Vec<KeyEvent>) {
for key in keys {
self.keys.push(key);
}
- self.update_key_desc();
}
pub fn no_doc(mut self) -> Self {
self.show_in_doc = false;