summaryrefslogtreecommitdiffstats
path: root/src/verb
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-08-03 20:49:25 +0200
committerCanop <cano.petrole@gmail.com>2021-08-04 13:25:29 +0200
commitc68e7f3bd12ad14214e074d90c1640d8b2536801 (patch)
tree797741ea2fae240960a9aa03ce3dadb79cb29856 /src/verb
parent3123abc98b2f2e8e52da3ecce96c690341e75c11 (diff)
improve scrolling behaviors
Especially move the selection when you're at one end and you try to scroll the blocked way. Fix #419
Diffstat (limited to 'src/verb')
-rw-r--r--src/verb/exec_pattern.rs2
-rw-r--r--src/verb/invocation_parser.rs4
-rw-r--r--src/verb/verb_invocation.rs2
-rw-r--r--src/verb/verb_store.rs2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/verb/exec_pattern.rs b/src/verb/exec_pattern.rs
index addf0b1..67d579a 100644
--- a/src/verb/exec_pattern.rs
+++ b/src/verb/exec_pattern.rs
@@ -72,7 +72,7 @@ impl ExecPattern {
Self::Array(
match self {
Self::String(s) => {
- splitty::split_unquoted_whitespace(&s)
+ splitty::split_unquoted_whitespace(s)
.unwrap_quotes(true)
.map(|s| f(s))
.collect()
diff --git a/src/verb/invocation_parser.rs b/src/verb/invocation_parser.rs
index 5a5504a..8129c70 100644
--- a/src/verb/invocation_parser.rs
+++ b/src/verb/invocation_parser.rs
@@ -101,7 +101,7 @@ impl InvocationParser {
}
}
(Some(ref s), Some(ref regex)) => {
- if regex.is_match(&s) {
+ if regex.is_match(s) {
None
} else {
Some(self.invocation_pattern.to_string_for_name(&invocation.name))
@@ -115,7 +115,7 @@ impl InvocationParser {
self.args_parser.as_ref()
.map(|r| {
let mut map = AHashMap::default();
- if let Some(input_cap) = r.captures(&args) {
+ if let Some(input_cap) = r.captures(args) {
for name in r.capture_names().flatten() {
if let Some(c) = input_cap.name(name) {
map.insert(name.to_string(), c.as_str().to_string());
diff --git a/src/verb/verb_invocation.rs b/src/verb/verb_invocation.rs
index 3a766ea..5d1d760 100644
--- a/src/verb/verb_invocation.rs
+++ b/src/verb/verb_invocation.rs
@@ -56,7 +56,7 @@ impl VerbInvocation {
s.push_str(name);
if let Some(args) = &self.args {
s.push(' ');
- s.push_str(&args);
+ s.push_str(args);
}
s
}
diff --git a/src/verb/verb_store.rs b/src/verb/verb_store.rs
index de728c0..ff139e6 100644
--- a/src/verb/verb_store.rs
+++ b/src/verb/verb_store.rs
@@ -87,7 +87,7 @@ impl VerbStore {
for name in &verb.names {
if name.starts_with(prefix) {
if name == prefix {
- return PrefixSearchResult::Match(name, &verb);
+ return PrefixSearchResult::Match(name, verb);
}
found_index = index;
nb_found += 1;