feat(core): wire up undo feature

This commit is contained in:
Federico Terzi 2021-08-15 11:10:31 +02:00
parent fb45f92b69
commit 7439cc1081
3 changed files with 9 additions and 1 deletions

View File

@ -90,7 +90,7 @@ impl<'a> espanso_engine::process::MatchFilter for ConfigManager<'a> {
.filter(|id| is_builtin_match(**id))
.map(|id| *id)
.collect();
let mut output = active_user_defined_matches;
output.extend(builtin_matches);
output
@ -160,3 +160,9 @@ impl<'a> espanso_engine::process::MatcherMiddlewareConfigProvider for ConfigMana
self.default().backspace_limit()
}
}
impl<'a> espanso_engine::process::UndoEnabledProvider for ConfigManager<'a> {
fn is_undo_enabled(&self) -> bool {
self.active().undo_backspace()
}
}

View File

@ -188,6 +188,7 @@ pub fn initialize_and_spawn(
disable_options,
&config_manager,
&combined_match_cache,
&config_manager,
);
let event_injector = EventInjectorAdapter::new(&*injector, &config_manager);

View File

@ -45,5 +45,6 @@ generate_patchable_config!(
word_separators -> Vec<String>,
backspace_limit -> usize,
apply_patch -> bool,
undo_backspace -> bool,
keyboard_layout -> Option<RMLVOConfig>
);