diff options
| author | Peng Wu <alexepico@gmail.com> | 2010-05-07 12:51:24 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2010-05-19 10:09:33 +0800 |
| commit | 209d06b04a13247ffd31895e9e87d59c25fd3b2d (patch) | |
| tree | a82940b28572a16e9583139a7d8fa16267e1b931 /lua/lua-ext-console.c | |
| parent | e63b0016502ff2f535894006c67364ed8fa48ef0 (diff) | |
refactor lua plugin interface.
Diffstat (limited to 'lua/lua-ext-console.c')
| -rw-r--r-- | lua/lua-ext-console.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lua/lua-ext-console.c b/lua/lua-ext-console.c index 6f61f25..9490cc9 100644 --- a/lua/lua-ext-console.c +++ b/lua/lua-ext-console.c @@ -34,15 +34,20 @@ void list_all_commands(IBusEnginePlugin * plugin){ int print_lua_call_result(IBusEnginePlugin * plugin, size_t num){ if ( 1 == num ) { - const char * result = ibus_engine_plugin_get_retval(plugin); - printf("result: %s.\n", result); + const lua_command_candidate_t * result = ibus_engine_plugin_get_retval(plugin); + if (result->content) + printf("result: %s.\n", result->content); } if ( num > 1) { GArray * results = ibus_engine_plugin_get_retvals(plugin); size_t i; for ( i = 0; i < results->len; ++i) { - const char * result = g_array_index(results, const char *, i); - printf("%d.%s >\t", i, result); + const lua_command_candidate_t * result = g_array_index(results, const lua_command_candidate_t *, i); + if (result->content) + printf("%d.%s >\t", i, result->content); + else{ + printf("%d. %s [%s]\t", i, result->suggest, result->help); + } } printf("\n"); } |
