summaryrefslogtreecommitdiffstats
path: root/src/verb
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2020-11-13 13:26:23 +0100
committerCanop <cano.petrole@gmail.com>2020-11-13 13:26:23 +0100
commit2fce268388ea71d8b4ed98facde6ce6c6b1d6a09 (patch)
treea8408e9d5ddfe308a32525b6cbf35c59ed6cf67b /src/verb
parent15c74c836b6b6e2a06d71358cca39bdb758148b0 (diff)
`:line_up` and `:line_down` accept an optional count as argument
This allows verbs like this: [[verbs]] key = "ctrl-u" invocation = "up4" execution = ":line_up 4" leave_broot = false Fix #301
Diffstat (limited to 'src/verb')
-rw-r--r--src/verb/internal.rs4
-rw-r--r--src/verb/mod.rs2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/verb/internal.rs b/src/verb/internal.rs
index 46eec23..ca2f48c 100644
--- a/src/verb/internal.rs
+++ b/src/verb/internal.rs
@@ -113,12 +113,16 @@ impl Internal {
pub fn invocation_pattern(self) -> &'static str {
match self {
Internal::focus => r"focus (?P<path>.*)?",
+ Internal::line_down => r"line_down (?P<count>\d*)?",
+ Internal::line_up => r"line_up (?P<count>\d*)?",
_ => self.name(),
}
}
pub fn exec_pattern(self) -> &'static str {
match self {
Internal::focus => r"focus {path}",
+ Internal::line_down => r"line_down {count}",
+ Internal::line_up => r"line_up {count}",
_ => self.name(),
}
}
diff --git a/src/verb/mod.rs b/src/verb/mod.rs
index 1657e1d..8b16b98 100644
--- a/src/verb/mod.rs
+++ b/src/verb/mod.rs
@@ -25,7 +25,7 @@ pub use {
verb::Verb,
verb_description::VerbDescription,
verb_execution::VerbExecution,
- verb_invocation::VerbInvocation,
+ verb_invocation::*,
verb_store::{PrefixSearchResult, VerbStore},
};