1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46:38 +02:00

irc: add option irc.look.list_buffer

This commit is contained in:
Sébastien Helleu
2023-11-24 19:42:28 +01:00
parent d4220e8144
commit 6d427421de
18 changed files with 72 additions and 17 deletions
+4 -2
View File
@@ -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,
+9
View File
@@ -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",
+1
View File
@@ -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;