diff options
| author | Peng Wu <alexepico@gmail.com> | 2025-01-03 13:04:34 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2025-01-03 13:27:45 +0800 |
| commit | 3e326ef1b20fe523cd60da8eccec40f62da2ada4 (patch) | |
| tree | 64a3b60c6b8efafd23f76ffa90c9fcf804db0934 /lua/lua-plugin.c | |
| parent | a5908b54351072241a5c259543f7d428069306af (diff) | |
| download | ibus-libpinyin-3e326ef1b20fe523cd60da8eccec40f62da2ada4.tar.gz ibus-libpinyin-3e326ef1b20fe523cd60da8eccec40f62da2ada4.tar.xz ibus-libpinyin-3e326ef1b20fe523cd60da8eccec40f62da2ada4.zip | |
Update ibus_engine_plugin_set_converter function
Diffstat (limited to 'lua/lua-plugin.c')
| -rw-r--r-- | lua/lua-plugin.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/lua-plugin.c b/lua/lua-plugin.c index 0fa4c96..fa7b33a 100644 --- a/lua/lua-plugin.c +++ b/lua/lua-plugin.c @@ -331,6 +331,16 @@ gboolean ibus_engine_plugin_set_converter(IBusEnginePlugin * plugin, const char IBusEnginePluginPrivate * priv = IBUS_ENGINE_PLUGIN_GET_PRIVATE(plugin); GArray * lua_converters = priv->lua_converters; + if (lua_function_name == NULL || *lua_function_name == '\0') { + g_free(priv->use_converter); + priv->use_converter = NULL; + return TRUE; + } + + /* The Lua converter is not changed. */ + if (g_strcmp0 (priv->use_converter, lua_function_name) == 0) + return TRUE; + gint i; for (i = 0; i < lua_converters->len; ++i) { lua_converter_t * converter = &g_array_index |
