1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

api: add function completion_set

This commit is contained in:
Sébastien Helleu
2025-02-15 23:22:44 +01:00
parent 1b54cd24ed
commit c7d21a3ea6
25 changed files with 577 additions and 16 deletions
+18
View File
@@ -4831,6 +4831,23 @@ API_FUNC(completion_get_string)
API_RETURN_STRING(result);
}
API_FUNC(completion_set)
{
const char *completion, *property, *value;
API_INIT_FUNC(1, "completion_set", API_RETURN_ERROR);
if (lua_gettop (L) < 3)
API_WRONG_ARGS(API_RETURN_ERROR);
completion = lua_tostring (L, -3);
property = lua_tostring (L, -2);
value = lua_tostring (L, -1);
weechat_completion_set (API_STR2PTR(completion), property, value);
API_RETURN_OK;
}
API_FUNC(completion_list_add)
{
const char *completion, *word, *where;
@@ -5932,6 +5949,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
API_DEF_FUNC(completion_new),
API_DEF_FUNC(completion_search),
API_DEF_FUNC(completion_get_string),
API_DEF_FUNC(completion_set),
API_DEF_FUNC(completion_list_add),
API_DEF_FUNC(completion_free),
API_DEF_FUNC(info_get),