summaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-07-10 22:28:15 +0200
committerCanop <cano.petrole@gmail.com>2022-07-10 22:29:23 +0200
commit94ef5f6ed4376df0d1b96b2ba38e8f5b2ca70ed9 (patch)
treed7056f2b4eb07aa4b2d99c0a832b560da90e766e /src/command
parentd4751c863011bf2583b07942363df3f70db37d97 (diff)
allow :focus based verbs to take a pattern
This allows verb definitions such as the following ones: ```Hjson { invocation: "gos" execution: ":focus" } { invocation: "go {path}" execution: ":focus {path}" } { invocation: "goroot" execution: ":focus /" } { invocation: "gotar {path}" execution: ":focus {path}/target" } ``` Fix #389
Diffstat (limited to 'src/command')
-rw-r--r--src/command/trigger_type.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/command/trigger_type.rs b/src/command/trigger_type.rs
index fed9222..d37e1e7 100644
--- a/src/command/trigger_type.rs
+++ b/src/command/trigger_type.rs
@@ -1,11 +1,15 @@
+use {
+ crate::verb::Verb,
+};
+
/// This rather vague enum might be precised or removed. It
/// serves today to characterize whether a verb execution
/// comes from the input or not (in this case the input is
/// consumed and cleared when the verb is executed).
#[derive(Debug, Clone, Copy, PartialEq)]
-pub enum TriggerType {
+pub enum TriggerType<'v> {
/// the verb was typed in the input and user has hit enter.
- Input,
+ Input(&'v Verb),
/// probably a key shortcut
Other,
}