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

Merge remote-tracking branch 'origin/pr/802'

This commit is contained in:
Sébastien Helleu
2016-12-17 07:51:47 +01:00
3 changed files with 44 additions and 26 deletions
+9
View File
@@ -83,6 +83,7 @@ struct t_config_option *config_startup_sys_rlimit;
/* config, look & feel section */
struct t_config_option *config_look_align_end_of_lines;
struct t_config_option *config_look_align_multiline_words;
struct t_config_option *config_look_bar_more_down;
struct t_config_option *config_look_bar_more_left;
struct t_config_option *config_look_bar_more_right;
@@ -2458,6 +2459,14 @@ config_weechat_init_options ()
NULL, NULL, NULL,
&config_change_buffers, NULL, NULL,
NULL, NULL, NULL);
config_look_align_multiline_words = config_file_new_option (
weechat_config_file, ptr_section,
"align_multiline_words", "boolean",
N_("align multiline words according to weechat.look.align_end_of_lines"),
NULL, 0, 0, "on", NULL, 0,
NULL, NULL, NULL,
&config_change_buffers, NULL, NULL,
NULL, NULL, NULL);
config_look_bar_more_down = config_file_new_option (
weechat_config_file, ptr_section,
"bar_more_down", "string",
+1
View File
@@ -133,6 +133,7 @@ extern struct t_config_option *config_startup_display_version;
extern struct t_config_option *config_startup_sys_rlimit;
extern struct t_config_option *config_look_align_end_of_lines;
extern struct t_config_option *config_look_align_multiline_words;
extern struct t_config_option *config_look_bar_more_down;
extern struct t_config_option *config_look_bar_more_left;
extern struct t_config_option *config_look_bar_more_right;
+34 -26
View File
@@ -490,39 +490,47 @@ gui_chat_display_word (struct t_gui_window *window,
{
/* insert spaces for aligning text under time/nick */
length_align = gui_line_get_align (window->buffer, line, 0, 0);
/* in the beginning of a line */
if ((window->win_chat_cursor_x == 0)
&& (*lines_displayed > pre_lines_displayed)
/* FIXME: modify arbitrary value for non aligning messages on time/nick? */
&& (length_align < (window->win_chat_width - 5)))
{
window->win_chat_cursor_x += length_align;
if ((CONFIG_INTEGER(config_look_align_end_of_lines) == CONFIG_LOOK_ALIGN_END_OF_LINES_MESSAGE)
&& (CONFIG_INTEGER(config_look_prefix_align) != CONFIG_LOOK_PREFIX_ALIGN_NONE)
&& CONFIG_STRING(config_look_prefix_suffix)
&& CONFIG_STRING(config_look_prefix_suffix)[0]
&& line->data->date > 0)
/* in the beginning of a word or in the middle of a word with multiline word align */
if ((chars_displayed == 0)
|| CONFIG_BOOLEAN(config_look_align_multiline_words))
{
if (!simulate)
window->win_chat_cursor_x += length_align;
if ((CONFIG_INTEGER(config_look_align_end_of_lines) == CONFIG_LOOK_ALIGN_END_OF_LINES_MESSAGE)
&& (CONFIG_INTEGER(config_look_prefix_align) != CONFIG_LOOK_PREFIX_ALIGN_NONE)
&& CONFIG_STRING(config_look_prefix_suffix)
&& CONFIG_STRING(config_look_prefix_suffix)[0]
&& line->data->date > 0)
{
gui_window_save_style (GUI_WINDOW_OBJECTS(window)->win_chat);
gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat,
GUI_COLOR_CHAT_PREFIX_SUFFIX);
gui_window_current_emphasis = 0;
if (!simulate)
{
gui_window_save_style (GUI_WINDOW_OBJECTS(window)->win_chat);
gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat,
GUI_COLOR_CHAT_PREFIX_SUFFIX);
gui_window_current_emphasis = 0;
}
chars_displayed += gui_chat_display_word_raw (window, line,
CONFIG_STRING(config_look_prefix_suffix),
0, simulate,
apply_style_inactive,
nick_offline);
window->win_chat_cursor_x += gui_chat_strlen_screen (CONFIG_STRING(config_look_prefix_suffix));
chars_displayed += gui_chat_display_word_raw (window, line,
str_space,
0, simulate,
apply_style_inactive,
nick_offline);
window->win_chat_cursor_x += gui_chat_strlen_screen (str_space);
if (!simulate)
gui_window_restore_style (GUI_WINDOW_OBJECTS(window)->win_chat);
}
chars_displayed += gui_chat_display_word_raw (window, line,
CONFIG_STRING(config_look_prefix_suffix),
0, simulate,
apply_style_inactive,
nick_offline);
window->win_chat_cursor_x += gui_chat_strlen_screen (CONFIG_STRING(config_look_prefix_suffix));
chars_displayed += gui_chat_display_word_raw (window, line,
str_space,
0, simulate,
apply_style_inactive,
nick_offline);
window->win_chat_cursor_x += gui_chat_strlen_screen (str_space);
if (!simulate)
gui_window_restore_style (GUI_WINDOW_OBJECTS(window)->win_chat);
}
if (window->win_chat_cursor_y < window->coords_size)
window->coords[window->win_chat_cursor_y].data = (char *)word + (ptr_data - data);
@@ -592,7 +600,7 @@ gui_chat_display_word (struct t_gui_window *window,
if ((!prefix && (ptr_data >= end_line)) ||
((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height)))
ptr_data = NULL;
}
}
free (data);