Skip to content

Commit

Permalink
feat: add reload command for rime_api_console (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Oct 17, 2023
1 parent f387307 commit 9b2689b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/rime_api_console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ int main(int argc, char* argv[]) {
rime->set_notification_handler(&on_message, NULL);

fprintf(stderr, "initializing...\n");
reload:
rime->initialize(NULL);
Bool full_check = True;
if (rime->start_maintenance(full_check))
Expand All @@ -219,6 +220,11 @@ int main(int argc, char* argv[]) {
}
if (!strcmp(line, "exit"))
break;
else if (!strcmp(line, "reload")) {
rime->destroy_session(session_id);
rime->finalize();
goto reload;
}
if (execute_special_command(line, session_id))
continue;
if (rime->simulate_key_sequence(session_id, line)) {
Expand Down

0 comments on commit 9b2689b

Please sign in to comment.