From 0c8812eb028340227bec9a135e0dd997236b3bf5 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Wed, 23 Oct 2019 19:26:06 +0200 Subject: [PATCH] Improve word matches support on macOS --- src/matcher/scrolling.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/matcher/scrolling.rs b/src/matcher/scrolling.rs index dad77c1..330a01a 100644 --- a/src/matcher/scrolling.rs +++ b/src/matcher/scrolling.rs @@ -94,10 +94,17 @@ impl <'a, R: MatchReceiver, M: ConfigManager<'a>> super::Matcher for ScrollingMa let active_config = self.config_manager.active_config(); // Check if the current char is a word separator - let is_current_word_separator = active_config.word_separators.contains( + let mut is_current_word_separator = active_config.word_separators.contains( &c.chars().nth(0).unwrap_or_default() ); + // Workaround needed on macos to consider espanso replacement key presses as separators. + if cfg!(target_os = "macos") { + if c.len() > 1 { + is_current_word_separator = true; + } + } + let mut was_previous_word_separator = self.was_previous_char_word_separator.borrow_mut(); let mut current_set_queue = self.current_set_queue.borrow_mut();