Add disable setting
This commit is contained in:
parent
5bc8de2408
commit
d59034390f
|
@ -21,6 +21,7 @@ const DEFAULT_CONFIG_FILE_NAME : &str = "default.yaml";
|
|||
// Default values for primitives
|
||||
fn default_name() -> String{ "default".to_owned() }
|
||||
fn default_filter_title() -> String{ "".to_owned() }
|
||||
fn default_disable() -> bool{ false }
|
||||
fn default_toggle_interval() -> u32 { 230 }
|
||||
fn default_backspace_limit() -> i32 { 3 }
|
||||
fn default_matches() -> Vec<Match> { Vec::new() }
|
||||
|
@ -33,6 +34,9 @@ pub struct Configs {
|
|||
#[serde(default = "default_filter_title")]
|
||||
pub filter_title: String,
|
||||
|
||||
#[serde(default = "default_disable")]
|
||||
pub disabled: bool,
|
||||
|
||||
#[serde(default)]
|
||||
pub toggle_key: KeyModifier,
|
||||
|
||||
|
|
|
@ -25,7 +25,11 @@ impl <'a, S: KeyboardSender, C: ClipboardManager, M: ConfigManager, U: UIManager
|
|||
MatchReceiver for Engine<'a, S, C, M, U>{
|
||||
|
||||
fn on_match(&self, m: &Match) {
|
||||
let config = self.config_manager.default_config();
|
||||
let config = self.config_manager.active_config();
|
||||
|
||||
if config.disabled {
|
||||
return;
|
||||
}
|
||||
|
||||
self.sender.delete_string(m.trigger.len() as i32);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user