Update preedit text with markedText

This fixes the preedit text being cleared when using shortcut keys to
switch candidate text in the input state.
This commit is contained in:
pagedown 2022-01-23 00:01:08 +08:00
parent c0be0f74d8
commit fbaf3e2f49
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -1401,7 +1401,7 @@ is_ascii_control_char(char x) {
}
if (!in_key_handler) {
debug_key("updating IME text in kitty from setMarkedText called from event loop: %s\n", _glfw.ns.text);
GLFWkeyevent glfw_keyevent = {.text=_glfw.ns.text, .ime_state = GLFW_IME_PREEDIT_CHANGED};
GLFWkeyevent glfw_keyevent = {.text=[[markedText string] UTF8String], .ime_state = GLFW_IME_PREEDIT_CHANGED};
_glfwInputKeyboard(window, &glfw_keyevent);
_glfw.ns.text[0] = 0;
}