summaryrefslogtreecommitdiffstats
path: root/src/verb/verb.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/verb/verb.rs')
-rw-r--r--src/verb/verb.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/verb/verb.rs b/src/verb/verb.rs
index 60b14d1..55aba13 100644
--- a/src/verb/verb.rs
+++ b/src/verb/verb.rs
@@ -71,7 +71,9 @@ pub struct Verb {
/// whether to show the verb in help screen
/// (if we show all input related actions, the doc is unusable)
- pub show_in_doc: bool
+ pub show_in_doc: bool,
+
+ pub panels: Vec<PanelStateType>,
}
impl PartialEq for Verb {
@@ -122,6 +124,7 @@ impl Verb {
needs_another_panel,
auto_exec: true,
show_in_doc: true,
+ panels: Vec::new(),
})
}
fn update_key_desc(&mut self) {
@@ -295,4 +298,8 @@ impl Verb {
pub fn is_sequence(&self) -> bool {
matches!(self.execution, VerbExecution::Sequence(_))
}
+
+ pub fn can_be_called_in_panel(&self, panel_state_type: PanelStateType) -> bool {
+ self.panels.is_empty() || self.panels.contains(&panel_state_type)
+ }
}