Skip to content

Commit

Permalink
feat: add reload command for rime_api_console (rime#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang authored and graphemecluster committed Oct 17, 2023
1 parent 04cb367 commit 0131f80
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 @@ -219,6 +219,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 = False;
if (rime->start_maintenance(full_check)) {
Expand Down Expand Up @@ -250,6 +251,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 0131f80

Please sign in to comment.