1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 04:16:38 +02:00

api: add function line_search_by_id

This commit is contained in:
Sébastien Helleu
2024-06-27 07:03:55 +02:00
parent 0e9ed21edf
commit f076db4767
26 changed files with 448 additions and 3 deletions
+18
View File
@@ -3990,6 +3990,23 @@ API_FUNC(buffer_match_list)
API_RETURN_INT(value);
}
API_FUNC(line_search_by_id)
{
char *buffer;
int id;
const char *result;
API_INIT_FUNC(1, "line_search_by_id", API_RETURN_EMPTY);
buffer = NULL;
id = 0;
if (!PyArg_ParseTuple (args, "si", &buffer, &id))
API_WRONG_ARGS(API_RETURN_EMPTY);
result = API_PTR2STR(weechat_line_search_by_id (API_STR2PTR(buffer), id));
API_RETURN_STRING(result);
}
API_FUNC(current_window)
{
const char *result;
@@ -5745,6 +5762,7 @@ PyMethodDef weechat_python_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),
+10
View File
@@ -1926,6 +1926,16 @@ def buffer_match_list(buffer: str, string: str) -> int:
...
def line_search_by_id(buffer: str, line_id: int) -> str:
"""`line_search_by_id in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_line_search_by_id>`_
::
# example
line = weechat.line_search_by_id(buffer, 123)
"""
...
def current_window() -> str:
"""`current_window in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_current_window>`_
::