mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 05:16:38 +02:00
api: add function line_search_by_id
This commit is contained in:
@@ -4083,6 +4083,23 @@ API_FUNC(buffer_match_list)
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
API_FUNC(line_search_by_id)
|
||||
{
|
||||
const char *buffer, *result;
|
||||
int id;
|
||||
|
||||
API_INIT_FUNC(1, "line_search_by_id", API_RETURN_EMPTY);
|
||||
if (lua_gettop (L) < 2)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
buffer = lua_tostring (L, -2);
|
||||
id = lua_tonumber (L, -1);
|
||||
|
||||
result = API_PTR2STR(weechat_line_search_by_id (API_STR2PTR(buffer), id));
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(current_window)
|
||||
{
|
||||
const char *result;
|
||||
@@ -5879,6 +5896,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
|
||||
API_DEF_FUNC(buffer_set),
|
||||
API_DEF_FUNC(buffer_string_replace_local_var),
|
||||
API_DEF_FUNC(buffer_match_list),
|
||||
API_DEF_FUNC(line_search_by_id),
|
||||
API_DEF_FUNC(current_window),
|
||||
API_DEF_FUNC(window_search_with_buffer),
|
||||
API_DEF_FUNC(window_get_integer),
|
||||
|
||||
Reference in New Issue
Block a user