From 2129494ae3fe2290e7d6b2843954a79760b9cee4 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sun, 22 Aug 2021 20:15:01 +0200 Subject: [PATCH] feat(core): wire up suppression middleware (enable=false in config) --- espanso/src/cli/worker/config.rs | 6 ++++++ espanso/src/cli/worker/engine/mod.rs | 1 + 2 files changed, 7 insertions(+) diff --git a/espanso/src/cli/worker/config.rs b/espanso/src/cli/worker/config.rs index 122c630..7179328 100644 --- a/espanso/src/cli/worker/config.rs +++ b/espanso/src/cli/worker/config.rs @@ -166,3 +166,9 @@ impl<'a> espanso_engine::process::UndoEnabledProvider for ConfigManager<'a> { self.active().undo_backspace() } } + +impl<'a> espanso_engine::process::EnabledStatusProvider for ConfigManager<'a> { + fn is_config_enabled(&self) -> bool { + self.active().enable() + } +} diff --git a/espanso/src/cli/worker/engine/mod.rs b/espanso/src/cli/worker/engine/mod.rs index c860233..ff32f98 100644 --- a/espanso/src/cli/worker/engine/mod.rs +++ b/espanso/src/cli/worker/engine/mod.rs @@ -189,6 +189,7 @@ pub fn initialize_and_spawn( &config_manager, &combined_match_cache, &config_manager, + &config_manager, ); let event_injector = EventInjectorAdapter::new(&*injector, &config_manager);