mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 07:55:10 +02:00
Use an enum for ime_state
This commit is contained in:
@@ -105,19 +105,19 @@ on_key_input(GLFWkeyevent *ev) {
|
||||
id_type active_window_id = w->id;
|
||||
|
||||
switch(ev->ime_state) {
|
||||
case 1: // update pre-edit text
|
||||
case GLFW_IME_PREEDIT_CHANGED:
|
||||
update_ime_position(global_state.callback_os_window, w, screen);
|
||||
screen_draw_overlay_text(screen, text);
|
||||
debug("updated pre-edit text: '%s'\n", text);
|
||||
return;
|
||||
case 2: // commit text
|
||||
case GLFW_IME_COMMIT_TEXT:
|
||||
if (*text) {
|
||||
schedule_write_to_child(w->id, 1, text, strlen(text));
|
||||
debug("committed pre-edit text: %s\n", text);
|
||||
} else debug("committed pre-edit text: (null)\n");
|
||||
screen_draw_overlay_text(screen, NULL);
|
||||
return;
|
||||
case 0:
|
||||
case GLFW_IME_NONE:
|
||||
// for macOS, update ime position on every key input
|
||||
// because the position is required before next input
|
||||
#if defined(__APPLE__)
|
||||
|
||||
Reference in New Issue
Block a user