diff options
author | Canop <cano.petrole@gmail.com> | 2020-05-16 21:43:33 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-05-16 21:43:33 +0200 |
commit | 1ca55d3b64ebd08e9c1e6b6097311bc59ec2c211 (patch) | |
tree | ab31cb202d88a17fd234dbb8738a1a82365f64a2 /src/verb/verb_store.rs | |
parent | 2b020b395a0f71e82639569932ee1d2c0ee09ed3 (diff) |
show purpose hint when in arg edition dedicated panel
Diffstat (limited to 'src/verb/verb_store.rs')
-rw-r--r-- | src/verb/verb_store.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/verb/verb_store.rs b/src/verb/verb_store.rs index 448b3e0..b94ab21 100644 --- a/src/verb/verb_store.rs +++ b/src/verb/verb_store.rs @@ -43,6 +43,7 @@ impl VerbStore { } self.verbs.extend(builtin_verbs()); } + pub fn search<'v>(&'v self, prefix: &str) -> PrefixSearchResult<'v, &Verb> { let mut found_index = 0; let mut nb_found = 0; @@ -66,6 +67,7 @@ impl VerbStore { _ => PrefixSearchResult::TooManyMatches(completions), } } + /// return the index of the verb which is triggered by the given keyboard key, if any pub fn index_of_key(&self, key: KeyEvent) -> Option<usize> { for i in 0..self.verbs.len() { @@ -77,4 +79,5 @@ impl VerbStore { } None } + } |