summaryrefslogtreecommitdiff
path: root/doc/it/weechat_plugin_api.it.txt
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-11-09 15:45:14 +0100
committerSebastien Helleu <flashcode@flashtux.org>2010-11-09 15:45:14 +0100
commit8c129779acf613fb1c23a6345eb64d745ef7e2f4 (patch)
treee969794a729ca30328644b360201b82bf6079cb4 /doc/it/weechat_plugin_api.it.txt
parent25879ca18965d8b2a6e9f5de290cf1bc5eb82ae6 (diff)
downloadweechat-8c129779acf613fb1c23a6345eb64d745ef7e2f4.zip
Add function "hook_completion_get_string" in plugin API
Diffstat (limited to 'doc/it/weechat_plugin_api.it.txt')
-rw-r--r--doc/it/weechat_plugin_api.it.txt59
1 files changed, 59 insertions, 0 deletions
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt
index 07e631548..3457f9667 100644
--- a/doc/it/weechat_plugin_api.it.txt
+++ b/doc/it/weechat_plugin_api.it.txt
@@ -7412,6 +7412,65 @@ hook = weechat.hook_completion("plugin_item", "my custom completion!",
"my_completion_cb", "")
----------------------------------------
+// TRANSLATION MISSING
+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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^