1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 03:25:41 +02:00

buflist: add option buflist.format.indent

This commit is contained in:
Sébastien Helleu
2017-04-23 14:49:04 +02:00
parent 2606b8a5a3
commit 671c216eb3
29 changed files with 222 additions and 179 deletions
+7 -7
View File
@@ -55,14 +55,15 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
char **buflist, *str_buflist, *condition;
char str_format_number[32], str_format_number_empty[32];
char str_nick_prefix[32];
char str_number[32], str_indent_name[4], *line, **hotlist, *str_hotlist;
char str_number[32], *line, **hotlist, *str_hotlist;
char str_hotlist_count[32];
const char *ptr_format, *ptr_format_current, *ptr_name, *ptr_type;
const char *ptr_nick, *ptr_nick_prefix;
const char *ptr_format, *ptr_format_current, *ptr_format_indent;
const char *ptr_name, *ptr_type, *ptr_nick, *ptr_nick_prefix;
const char *ptr_hotlist_format, *ptr_hotlist_priority;
const char *hotlist_priority_none = "none";
const char *hotlist_priority[4] = { "low", "message", "private",
"highlight" };
const char indent_empty[1] = { '\0' };
const char *ptr_lag;
int is_channel, is_private;
int i, j, length_max_number, current_buffer, number, prev_number, priority;
@@ -163,12 +164,11 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
prev_number = number;
/* buffer name */
str_indent_name[0] = '\0';
ptr_type = weechat_buffer_get_string (ptr_buffer, "localvar_type");
is_channel = (ptr_type && (strcmp (ptr_type, "channel") == 0));
is_private = (ptr_type && (strcmp (ptr_type, "private") == 0));
if (is_channel || is_private)
snprintf (str_indent_name, sizeof (str_indent_name), " ");
ptr_format_indent = (is_channel || is_private) ?
weechat_config_string (buflist_config_format_indent) : indent_empty;
/* nick prefix */
str_nick_prefix[0] = '\0';
@@ -216,7 +216,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
weechat_config_string (
buflist_config_format_number));
weechat_hashtable_set (buflist_hashtable_extra_vars,
"indent", str_indent_name);
"indent", ptr_format_indent);
weechat_hashtable_set (buflist_hashtable_extra_vars,
"name", ptr_name);
+2 -1
View File
@@ -98,7 +98,8 @@ buflist_command_init ()
" - ${number}: indented number, for example \" 1\" if there "
"are between 10 and 99 buffers\n"
" - ${indent}: indentation for name (channel and private "
"buffers are indented)\n"
"buffers are indented) (evaluation of "
"option buflist.format.indent)\n"
" - ${nick_prefix}: nick prefix for a channel (set only "
"if the option buflist.look.nick_prefix is enabled)\n"
" - ${name}: the short name (if set), with a fallback on the "
File diff suppressed because it is too large Load Diff
+1
View File
@@ -47,6 +47,7 @@ extern struct t_config_option *buflist_config_format_hotlist;
extern struct t_config_option *buflist_config_format_hotlist_level[4];
extern struct t_config_option *buflist_config_format_hotlist_level_none;
extern struct t_config_option *buflist_config_format_hotlist_separator;
extern struct t_config_option *buflist_config_format_indent;
extern struct t_config_option *buflist_config_format_lag;
extern struct t_config_option *buflist_config_format_number;