activate profile

This commit is contained in:
mii443
2024-09-23 17:09:38 +09:00
parent 4efed72eba
commit ec07cb9490
3 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,5 @@
use crate::{config::Config, converter::converter::{get_custom_converter, Converter}, STATE}; use crate::{config::Config, converter::converter::{get_custom_converter, Converter}, STATE};
use anyhow::Result; use anyhow::Result;
use regex::Regex;
pub struct ConversionBlock { pub struct ConversionBlock {
pub text: String, pub text: String,

View File

@ -15,6 +15,7 @@ impl SearchCandidateProvider {
pub fn create() -> Result<Self> { pub fn create() -> Result<Self> {
let profile_mgr = InputProcessorProfileMgr::new()?; let profile_mgr = InputProcessorProfileMgr::new()?;
let profile = profile_mgr.get_active_profile()?; let profile = profile_mgr.get_active_profile()?;
profile_mgr.activate_profile(&profile)?;
let thread_mgr = ThreadMgr::new()?; let thread_mgr = ThreadMgr::new()?;
let _client_id = thread_mgr.activate_ex(TF_TMAE_NOACTIVATEKEYBOARDLAYOUT)?; let _client_id = thread_mgr.activate_ex(TF_TMAE_NOACTIVATEKEYBOARDLAYOUT)?;

View File

@ -34,6 +34,8 @@ impl TsfConversion {
println!("{} == {}", text, self.conversion_history.last().unwrap_or(&("".to_string())).clone()); 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(); 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 { if !same_as_last_conversion && self.now_reconvertion {
self.now_reconvertion = false; self.now_reconvertion = false;
self.reconversion_prefix = None; self.reconversion_prefix = None;