From 17e1747a8290399983bc99af6afd294cba0c29dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 16 Nov 2015 20:24:45 +0100 Subject: [PATCH] irc: use current channel first in completion "irc_channels" (task #12923, issue #392) --- ChangeLog.asciidoc | 2 ++ src/plugins/irc/irc-completion.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 055b5a762..3f0c36496 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -26,6 +26,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * api: add function string_hex_dump() * api: add argument "length" in function utf8_is_valid() * alias: display completion in /alias list (issue #518) +* irc: use current channel first in completion "irc_channels" + (task #12923, issue #392) * irc: add support of "cap-notify" capability (issue #182, issue #477) * irc: add command /cap (issue #8) * irc: add hex dump of messages in raw buffer when debug is enabled for irc diff --git a/src/plugins/irc/irc-completion.c b/src/plugins/irc/irc-completion.c index 831429fe9..1a7ed2f3e 100644 --- a/src/plugins/irc/irc-completion.c +++ b/src/plugins/irc/irc-completion.c @@ -480,6 +480,14 @@ irc_completion_channels_cb (void *data, const char *completion_item, } } + /* add current channel first in list */ + irc_buffer_get_server_and_channel (buffer, NULL, &ptr_channel); + if (ptr_channel) + { + weechat_hook_completion_list_add (completion, ptr_channel->name, + 0, WEECHAT_LIST_POS_BEGINNING); + } + return WEECHAT_RC_OK; }