From 0d70cd84059103cfb3282aee11b40cdbc8df5714 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Tue, 24 Aug 2021 20:09:47 +0200 Subject: [PATCH] feat(config): add support for search-related fields in legacy config --- espanso-config/src/legacy/config.rs | 12 ++++++++++++ espanso-config/src/legacy/mod.rs | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/espanso-config/src/legacy/config.rs b/espanso-config/src/legacy/config.rs index 312d148..1612282 100644 --- a/espanso-config/src/legacy/config.rs +++ b/espanso-config/src/legacy/config.rs @@ -156,6 +156,12 @@ fn default_post_inject_delay() -> u64 { fn default_wait_for_modifiers_release() -> bool { false } +fn default_search_trigger() -> Option { + Some("jkj".to_string()) +} +fn default_search_shortcut() -> Option { + Some("ALT+SPACE".to_string()) +} #[derive(Clone, Debug, Serialize, Deserialize)] pub struct LegacyConfig { @@ -282,6 +288,12 @@ pub struct LegacyConfig { #[serde(default = "default_modulo_path")] pub modulo_path: Option, + #[serde(default = "default_search_trigger")] + pub search_trigger: Option, + + #[serde(default = "default_search_shortcut")] + pub search_shortcut: Option, + #[serde(default = "default_wait_for_modifiers_release")] pub wait_for_modifiers_release: bool, } diff --git a/espanso-config/src/legacy/mod.rs b/espanso-config/src/legacy/mod.rs index d7a9dbc..10fea96 100644 --- a/espanso-config/src/legacy/mod.rs +++ b/espanso-config/src/legacy/mod.rs @@ -360,11 +360,11 @@ impl Config for LegacyInteropConfig { } fn search_trigger(&self) -> Option { - None + self.config.search_trigger.clone() } fn search_shortcut(&self) -> Option { - None + self.config.search_shortcut.clone() } fn undo_backspace(&self) -> bool {