diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-11-09 15:45:14 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-11-09 15:45:14 +0100 |
commit | 8c129779acf613fb1c23a6345eb64d745ef7e2f4 (patch) | |
tree | e969794a729ca30328644b360201b82bf6079cb4 /doc/en | |
parent | 25879ca18965d8b2a6e9f5de290cf1bc5eb82ae6 (diff) | |
download | weechat-8c129779acf613fb1c23a6345eb64d745ef7e2f4.zip |
Add function "hook_completion_get_string" in plugin API
Diffstat (limited to 'doc/en')
-rw-r--r-- | doc/en/weechat_plugin_api.en.txt | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index d9f657df4..1f19900d5 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -7342,6 +7342,64 @@ hook = weechat.hook_completion("plugin_item", "my custom completion!", "my_completion_cb", "") ---------------------------------------- +weechat_hook_completion_get_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.4._ + +Get a completion property as string. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_hook_completion_get_string (struct t_gui_completion *completion, + const char *property); +---------------------------------------- + +Arguments: + +* 'completion': completion pointer +* 'property': property name: +** 'base_command': command used for completion +** 'base_word': word being completed +** 'args': command arguments (including base word) + +C example: + +[source,C] +---------------------------------------- +int +my_completion_cb (void *data, const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + /* get arguments of command */ + const char *args = weechat_hook_completion_get_string (completion, "args"); + + /* completion depending on args */ + /* ... */ + + return WEECHAT_RC_OK; +} +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hook_completion_get_string(completion, property) + +# example +def my_completion_cb(data, completion_item, buffer, completion): + # get arguments of command + args = weechat.hook_completion_get_string(completion, "args") + # completion depending on args + # ... + return weechat.WEECHAT_RC_OK +---------------------------------------- + weechat_hook_completion_list_add ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |