From 9285afc3e2a295ba854ea720c0d85f2a17d73176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 15 Feb 2025 23:32:33 +0100 Subject: [PATCH] irc: keep spaces at the end of /topic command arguments --- src/plugins/irc/irc-command.c | 3 ++- src/plugins/irc/irc-completion.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 1eaec5fb7..7de6f253b 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -8071,7 +8071,7 @@ irc_command_init () WEECHAT_CMD_ARGS_DESC( N_("target: query time from specified server")), NULL, &irc_command_time, NULL, NULL); - weechat_hook_command ( + ptr_hook = weechat_hook_command ( "topic", N_("get/set channel topic"), /* TRANSLATORS: only text between angle brackets (eg: "") may be translated */ @@ -8081,6 +8081,7 @@ irc_command_init () N_("topic: new topic"), N_("raw[-delete]: delete channel topic")), "%(irc_channel_topic)|-delete", &irc_command_topic, NULL, NULL); + IRC_COMMAND_KEEP_SPACES; weechat_hook_command ( "trace", N_("find the route to specific server"), diff --git a/src/plugins/irc/irc-completion.c b/src/plugins/irc/irc-completion.c index 95e10ba16..6176fd4b3 100644 --- a/src/plugins/irc/irc-completion.c +++ b/src/plugins/irc/irc-completion.c @@ -563,6 +563,8 @@ irc_completion_channel_topic_cb (const void *pointer, void *data, (void) data; (void) completion_item; + weechat_completion_set (completion, "add_space", "0"); + if (ptr_channel && ptr_channel->topic && ptr_channel->topic[0]) { if (irc_server_strncasecmp (ptr_server, ptr_channel->topic,