diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-12-05 14:27:01 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-12-05 14:27:01 +0000 |
commit | a1bc5ce60ffabe0b697e53f1bb82f3ccfbaa3302 (patch) | |
tree | dc4e3635d9eda3fe33c83b5623eba1a9d5b92271 /src/gui/curses | |
parent | 10ab4b0a2005e4374e67d06d9a2c575787e54889 (diff) | |
download | weechat-a1bc5ce60ffabe0b697e53f1bb82f3ccfbaa3302.zip |
Fixed display bug with color for first line on screen (bug #17719)
Diffstat (limited to 'src/gui/curses')
-rw-r--r-- | src/gui/curses/gui-curses-chat.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index 7c70b5854..2ad35842d 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -478,13 +478,14 @@ gui_chat_word_get_next_char (t_gui_window *window, unsigned char *string, */ void -gui_chat_display_word_raw (t_gui_window *window, char *string) +gui_chat_display_word_raw (t_gui_window *window, char *string, int display) { char *prev_char, *next_char, saved_char, *output; - - wmove (GUI_CURSES(window)->win_chat, - window->win_chat_cursor_y, - window->win_chat_cursor_x); + + if (display) + wmove (GUI_CURSES(window)->win_chat, + window->win_chat_cursor_y, + window->win_chat_cursor_x); while (string && string[0]) { @@ -493,7 +494,7 @@ gui_chat_display_word_raw (t_gui_window *window, char *string) return; prev_char = utf8_prev_char (string, next_char); - if (prev_char) + if (display && prev_char) { saved_char = next_char[0]; next_char[0] = '\0'; @@ -572,18 +573,26 @@ gui_chat_display_word (t_gui_window *window, pos_saved_char = gui_word_real_pos (window, data, num_displayed); saved_char = data[pos_saved_char]; data[pos_saved_char] = '\0'; - if ((!simulate) && - ((count == 0) || (*lines_displayed >= num_lines - count))) - gui_chat_display_word_raw (window, data); + if (!simulate) + { + if ((count == 0) || (*lines_displayed >= num_lines - count)) + gui_chat_display_word_raw (window, data, 1); + else + gui_chat_display_word_raw (window, data, 0); + } data[pos_saved_char] = saved_char; data += pos_saved_char; } else { num_displayed = chars_to_display; - if ((!simulate) && - ((count == 0) || (*lines_displayed >= num_lines - count))) - gui_chat_display_word_raw (window, data); + if (!simulate) + { + if ((count == 0) || (*lines_displayed >= num_lines - count)) + gui_chat_display_word_raw (window, data, 1); + else + gui_chat_display_word_raw (window, data, 0); + } data += strlen (data); } |