From 09f7835eb9d43cba2de98edd0ee89518fc4647d6 Mon Sep 17 00:00:00 2001 From: pentamassiv Date: Tue, 13 Oct 2020 23:39:27 +0200 Subject: [PATCH] Added update to cursor when string is committed --- src/imservice.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imservice.rs b/src/imservice.rs index a56bbc2c..e303e08a 100644 --- a/src/imservice.rs +++ b/src/imservice.rs @@ -380,7 +380,8 @@ impl IMService { let cursor_position = self.pending.cursor.try_into().unwrap(); // Converts u32 of cursor to usize self.pending .surrounding_text - .insert_str(cursor_position, &text); + .insert_str(cursor_position, text); + self.pending.cursor += text.len() as u32; unsafe { c::eek_input_method_commit_string(self.im, text.as_ptr()) }