diff --git a/ChangeLog b/ChangeLog index 3517bb2a5..2581aba67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.4.2-rc2, 2013-09-24 +v0.4.2-rc2, 2013-09-30 This document lists all changes for each version. @@ -14,6 +14,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] Version 0.4.2 (under dev!) -------------------------- +* core: clear whole line before displaying content instead of clearing after + the end of content (bug #40115) * core: fix time displayed in status bar (it was one second late) (bug #40097) * core: fix memory leak on unhook of a print hook (if using tags) * core: fix computation of columns in output of /help (take care about size of diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index cfa7d5cd4..331567f7e 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -145,6 +145,22 @@ gui_chat_reset_style (struct t_gui_window *window, struct t_gui_line *line, gui_window_reset_color (GUI_WINDOW_OBJECTS(window)->win_chat, color); } +/* + * Deletes all chars from the cursor to the end of the current line. + */ + +void +gui_chat_clrtoeol (struct t_gui_window *window) +{ + if (window->win_chat_cursor_y >= window->win_chat_height) + return; + + wmove (GUI_WINDOW_OBJECTS(window)->win_chat, + window->win_chat_cursor_y, + window->win_chat_cursor_x); + wclrtoeol (GUI_WINDOW_OBJECTS(window)->win_chat); +} + /* * Displays a new line. */ @@ -155,19 +171,13 @@ gui_chat_display_new_line (struct t_gui_window *window, int *lines_displayed, int simulate) { if ((count == 0) || (*lines_displayed >= num_lines - count)) - { - if ((!simulate) - && (window->win_chat_cursor_x <= gui_chat_get_real_width (window) - 1)) - { - wmove (GUI_WINDOW_OBJECTS(window)->win_chat, - window->win_chat_cursor_y, - window->win_chat_cursor_x); - wclrtoeol (GUI_WINDOW_OBJECTS(window)->win_chat); - } window->win_chat_cursor_y++; - } + window->win_chat_cursor_x = 0; (*lines_displayed)++; + + if (!simulate) + gui_chat_clrtoeol (window); } /* @@ -665,6 +675,7 @@ gui_chat_display_time_to_prefix (struct t_gui_window *window, GUI_COLOR_CHAT_INACTIVE_WINDOW, GUI_COLOR_CHAT_INACTIVE_BUFFER, GUI_COLOR_CHAT); + gui_chat_clrtoeol (window); } /* display time */