| 83 | } |
| 84 | |
| 85 | void engine_commit() { |
| 86 | uintptr_t index = 0; |
| 87 | IBusText *text = nullptr; |
| 88 | |
| 89 | if (!riti_suggestion_is_lonely(suggestion)) { |
| 90 | index = ibus_lookup_table_get_cursor_pos(table); |
| 91 | text = ibus_lookup_table_get_candidate(table, index); |
| 92 | } else { |
| 93 | index = 0; |
| 94 | char *txt = riti_suggestion_get_lonely_suggestion(suggestion); |
| 95 | text = ibus_text_new_from_string(txt); |
| 96 | } |
| 97 | |
| 98 | engine_commit_text(text); |
| 99 | riti_context_candidate_committed(ctx, index); |
| 100 | } |
| 101 | |
| 102 | /************************************* Callbacks *************************************/ |
| 103 |
no test coverage detected