From d3020976d59e5e329c851f104c633427eafe2cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 27 Apr 2020 00:14:36 +0200 Subject: api: add functions completion_new, completion_search and completion_free (issue #1484) --- doc/it/autogen/plugin_api/hdata.adoc | 9 ++- doc/it/weechat_plugin_api.it.adoc | 125 +++++++++++++++++++++++++++++++++++ doc/it/weechat_scripting.it.adoc | 6 ++ 3 files changed, 138 insertions(+), 2 deletions(-) (limited to 'doc/it') diff --git a/doc/it/autogen/plugin_api/hdata.adoc b/doc/it/autogen/plugin_api/hdata.adoc index e8d5d0228..feab3455d 100644 --- a/doc/it/autogen/plugin_api/hdata.adoc +++ b/doc/it/autogen/plugin_api/hdata.adoc @@ -643,8 +643,11 @@ _next_buffer_   (pointer, hdata: "buffer_visited") + | weechat | [[hdata_completion]]<> | struttura con completamento -| - -| _buffer_   (pointer, hdata: "buffer") + +| _weechat_completions_ + +_last_weechat_completion_ + + +| _plugin_   (pointer, hdata: "plugin") + +_buffer_   (pointer, hdata: "buffer") + _context_   (integer) + _base_command_   (string) + _base_command_arg_index_   (integer) + @@ -663,6 +666,8 @@ _position_replace_   (integer) + _diff_size_   (integer) + _diff_length_   (integer) + _partial_list_   (pointer) + +_prev_completion_   (pointer, hdata: "completion") + +_next_completion_   (pointer, hdata: "completion") + | weechat diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index 135370c92..6494b5c75 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -15535,6 +15535,131 @@ weechat.command_options(buffer, command, options) rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) ---- +// TRANSLATION MISSING +[[completion]] +=== Completion + +Functions to complete a command line. + +// TRANSLATION MISSING +==== completion_new + +_WeeChat ≥ 2.9._ + +Create a new completion. + +Prototipo: + +[source,C] +---- +struct t_gui_completion *weechat_completion_new (struct t_gui_buffer *buffer); +---- + +Argomenti: + +* _buffer_: buffer pointer + +Valori restituiti: + +* pointer to new completion + +Esempio in C: + +[source,C] +---- +struct t_gui_completion *completion = weechat_completion_new (weechat_buffer_search_main ()); +---- + +Script (Python): + +[source,python] +---- +# prototipo +completion = weechat.completion_new(buffer) + +# esempio +completion = weechat.completion_new(weechat.buffer_search_main()) +---- + +// TRANSLATION MISSING +==== completion_search + +_WeeChat ≥ 2.9._ + +Search possible words at a given position of a string, in the completion +context. + +Prototipo: + +[source,C] +---- +void weechat_completion_search (struct t_gui_completion *completion, const char *data, + int position, int direction); +---- + +Argomenti: + +* _completion_: completion pointer +* _data_: the string to complete +* _position_: index of the char in string to complete (starts to 0) +* _direction_: 1 for next completion, -1 for previous completion + +Esempio in C: + +[source,C] +---- +struct t_gui_completion *completion = weechat_completion_new (weechat_buffer_search_main ()); +weechat_completion_search (completion, "/help filt", 10, 1); +---- + +Script (Python): + +[source,python] +---- +# prototipo +weechat.completion_search(completion, data, position, direction) + +# esempio +completion = weechat.completion_new(weechat.buffer_search_main()) +weechat.completion_search(completion, "/help filt", 10, 1); +---- + +// TRANSLATION MISSING +==== completion_free + +_WeeChat ≥ 2.9._ + +Free a completion. + +Prototipo: + +[source,C] +---- +void weechat_completion_free (struct t_gui_completion *completion); +---- + +Argomenti: + +* _completion_: completion pointer + +Esempio in C: + +[source,C] +---- +weechat_completion_free (completion); +---- + +Script (Python): + +[source,python] +---- +# prototipo +weechat.completion_free(completion) + +# esempio +weechat.completion_free(completion) +---- + [[network]] === Network diff --git a/doc/it/weechat_scripting.it.adoc b/doc/it/weechat_scripting.it.adoc index 6fad5a37b..5e9864087 100644 --- a/doc/it/weechat_scripting.it.adoc +++ b/doc/it/weechat_scripting.it.adoc @@ -728,6 +728,12 @@ Elenco di funzioni nelle API per gli script: command + command_options +// TRANSLATION MISSING +| completion | + completion_new + + completion_search + + completion_free + | info | info_get + info_get_hashtable -- cgit v1.2.3