summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-11-24 19:42:28 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-11-24 19:42:28 +0100
commit6d427421de28fb4d29e9dc0edca360219eb6571f (patch)
tree83d03c61968c1b011f3dd523271fb8459acccd0e /src
parentd4220e814467a78cb4912663de9f1106e6c8f2ce (diff)
downloadweechat-6d427421de28fb4d29e9dc0edca360219eb6571f.zip
irc: add option irc.look.list_buffer
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-command.c6
-rw-r--r--src/plugins/irc/irc-config.c9
-rw-r--r--src/plugins/irc/irc-config.h1
3 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 39c5a3432..8f6f165d5 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -3391,7 +3391,7 @@ IRC_COMMAND_CALLBACK(list)
struct t_hashtable *hashtable;
char buf[512], *ptr_channel_name, *ptr_server_name, *ptr_regex;
regex_t *new_regexp;
- int i, ret, value;
+ int i, ret, value, use_list_buffer;
IRC_BUFFER_GET_SERVER(buffer);
@@ -3403,6 +3403,7 @@ IRC_COMMAND_CALLBACK(list)
ptr_server_name = NULL;
ptr_regex = NULL;
new_regexp = NULL;
+ use_list_buffer = weechat_config_boolean (irc_config_look_list_buffer);
if ((argc > 0) && (weechat_strcmp (argv[1], "-up") == 0))
{
@@ -3483,6 +3484,7 @@ IRC_COMMAND_CALLBACK(list)
if (argc <= i + 1)
WEECHAT_COMMAND_ERROR;
ptr_regex = argv_eol[i + 1];
+ use_list_buffer = 0;
i++;
}
else if (!ptr_channel_name)
@@ -3535,7 +3537,7 @@ IRC_COMMAND_CALLBACK(list)
ptr_server->cmd_list_regexp = NULL;
}
- if (ptr_server->list && !ptr_server->cmd_list_regexp)
+ if (ptr_server->list && use_list_buffer)
{
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index c17173ff3..21606cfdb 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -93,6 +93,7 @@ struct t_config_option *irc_config_look_item_display_server = NULL;
struct t_config_option *irc_config_look_item_nick_modes = NULL;
struct t_config_option *irc_config_look_item_nick_prefix = NULL;
struct t_config_option *irc_config_look_join_auto_add_chantype = NULL;
+struct t_config_option *irc_config_look_list_buffer = NULL;
struct t_config_option *irc_config_look_list_buffer_scroll_horizontal = NULL;
struct t_config_option *irc_config_look_list_buffer_sort = NULL;
struct t_config_option *irc_config_look_list_buffer_topic_strip_colors = NULL;
@@ -3332,6 +3333,14 @@ irc_config_init ()
"will in fact send: \"/join #weechat\""),
NULL, 0, 0, "off", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ irc_config_look_list_buffer = weechat_config_new_option (
+ irc_config_file, irc_config_section_look,
+ "list_buffer", "boolean",
+ N_("use a dedicated buffer for the output of /list"),
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_list_buffer_scroll_horizontal = weechat_config_new_option (
irc_config_file, irc_config_section_look,
"list_buffer_scroll_horizontal", "integer",
diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h
index 333f8c712..26f12bf65 100644
--- a/src/plugins/irc/irc-config.h
+++ b/src/plugins/irc/irc-config.h
@@ -128,6 +128,7 @@ extern struct t_config_option *irc_config_look_item_display_server;
extern struct t_config_option *irc_config_look_item_nick_modes;
extern struct t_config_option *irc_config_look_item_nick_prefix;
extern struct t_config_option *irc_config_look_join_auto_add_chantype;
+extern struct t_config_option *irc_config_look_list_buffer;
extern struct t_config_option *irc_config_look_list_buffer_scroll_horizontal;
extern struct t_config_option *irc_config_look_list_buffer_sort;
extern struct t_config_option *irc_config_look_list_buffer_topic_strip_colors;