Improve word matches support on macOS

This commit is contained in:
Federico Terzi 2019-10-23 19:26:06 +02:00
parent 5f71d0ad24
commit 0c8812eb02

View File

@ -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();