diff --git a/espanso/src/patch/config_store.rs b/espanso/src/patch/config_store.rs index 8594a23..65c29c8 100644 --- a/espanso/src/patch/config_store.rs +++ b/espanso/src/patch/config_store.rs @@ -69,6 +69,10 @@ impl ConfigStore for PatchedConfigStore { fn active<'f>(&'f self, app: &espanso_config::config::AppProperties) -> Arc { let active_config = self.config_store.active(app); + if !active_config.apply_patch() { + return active_config; + } + // Check if a patch should be applied if let Some(patch) = self.patches.iter().find(|patch| (patch.should_patch)(app)) { (patch.apply)(active_config) diff --git a/espanso/src/patch/patches/mod.rs b/espanso/src/patch/patches/mod.rs index 091b2f9..8b04932 100644 --- a/espanso/src/patch/patches/mod.rs +++ b/espanso/src/patch/patches/mod.rs @@ -40,5 +40,6 @@ generate_patchable_config!( inject_delay -> Option, key_delay -> Option, word_separators -> Vec, - backspace_limit -> usize + backspace_limit -> usize, + apply_patch -> bool );