diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2012-08-22 14:07:01 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2012-08-22 14:07:01 +0200 |
commit | d8d0d6e4c646a38cf2bbb320eb1dc98afd464c73 (patch) | |
tree | 925844e20903a6507beabe80ffd1716e8453ffb0 | |
parent | d81d5c09d146a0a26ead47bf7334c917ebc08189 (diff) | |
download | weechat-d8d0d6e4c646a38cf2bbb320eb1dc98afd464c73.zip |
core: display spaces at the end of messages in chat area (bug #37024)
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-chat.c | 9 | ||||
-rw-r--r-- | src/gui/gui-chat.c | 3 |
3 files changed, 12 insertions, 1 deletions
@@ -7,6 +7,7 @@ v0.3.9-dev, 2012-08-22 Version 0.3.9 (under dev!) -------------------------- +* core: display spaces at the end of messages in chat area (bug #37024) * core: fix infinite loop in display when chat area has width of 1 with a bar displayed on the right (nicklist by default) (bug #37089) * core: fix display of "bar more down" char when text is truncated by size_max diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index f911e57ad..ada131177 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -1119,15 +1119,22 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line, ptr_end_offset = ptr_data + word_end_offset; + /* if message ends with spaces, display them */ + if ((word_length == 0) && (word_length_with_spaces > 0) + && !ptr_data[word_end_offset + 1]) + { + word_length = word_length_with_spaces; + } + if (word_length > 0) { - /* spaces + word too long for current line but ok for next line */ line_align = gui_line_get_align (window->buffer, line, 1, (lines_displayed == 0) ? 1 : 0, GUI_WINDOW_OBJECTS(window)->force_prefix_for_line); if ((window->win_chat_cursor_x + word_length_with_spaces > gui_chat_get_real_width (window)) && (word_length <= gui_chat_get_real_width (window) - line_align)) { + /* spaces + word too long for current line but ok for next line */ gui_chat_display_new_line (window, num_lines, count, &lines_displayed, simulate); /* apply styles before jumping to start of word */ diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index 949990f04..6c6b1eeee 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -306,7 +306,10 @@ gui_chat_get_word_info (struct t_gui_window *window, else { if (leading_spaces) + { (*word_length_with_spaces)++; + *word_end_offset = next_char2 - start_data - 1; + } else { *word_end_offset = next_char - start_data - 1; |