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 7984296 commit 1a8e11c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/rime_api_console.cc
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);
rime->start_quick();
rime->deploy_config_file("common.yaml", "config_version");
Expand Down Expand Up @@ -249,6 +250,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 1a8e11c

Please sign in to comment.