From ec07cb9490bb7f43a296a87f2ad82caa1625e954 Mon Sep 17 00:00:00 2001 From: mii443 Date: Mon, 23 Sep 2024 17:09:38 +0900 Subject: [PATCH] activate profile --- src-tauri/src/conversion.rs | 1 - src-tauri/src/tsf/search_candidate_provider.rs | 1 + src-tauri/src/tsf_conversion.rs | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/conversion.rs b/src-tauri/src/conversion.rs index 71bece7..8df3128 100644 --- a/src-tauri/src/conversion.rs +++ b/src-tauri/src/conversion.rs @@ -1,6 +1,5 @@ use crate::{config::Config, converter::converter::{get_custom_converter, Converter}, STATE}; use anyhow::Result; -use regex::Regex; pub struct ConversionBlock { pub text: String, diff --git a/src-tauri/src/tsf/search_candidate_provider.rs b/src-tauri/src/tsf/search_candidate_provider.rs index 48f5abc..c525db3 100644 --- a/src-tauri/src/tsf/search_candidate_provider.rs +++ b/src-tauri/src/tsf/search_candidate_provider.rs @@ -15,6 +15,7 @@ impl SearchCandidateProvider { pub fn create() -> Result { let profile_mgr = InputProcessorProfileMgr::new()?; let profile = profile_mgr.get_active_profile()?; + profile_mgr.activate_profile(&profile)?; let thread_mgr = ThreadMgr::new()?; let _client_id = thread_mgr.activate_ex(TF_TMAE_NOACTIVATEKEYBOARDLAYOUT)?; diff --git a/src-tauri/src/tsf_conversion.rs b/src-tauri/src/tsf_conversion.rs index a204d39..d0647c3 100644 --- a/src-tauri/src/tsf_conversion.rs +++ b/src-tauri/src/tsf_conversion.rs @@ -34,6 +34,8 @@ impl TsfConversion { println!("{} == {}", text, self.conversion_history.last().unwrap_or(&("".to_string())).clone()); let same_as_last_conversion = text.to_string() == self.conversion_history.last().unwrap_or(&("".to_string())).clone(); + self.target_text = text.to_string(); + if !same_as_last_conversion && self.now_reconvertion { self.now_reconvertion = false; self.reconversion_prefix = None;