1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

core: clear whole line before displaying content instead of clearing after the end of content (bug #40115)

This commit is contained in:
Sebastien Helleu
2013-09-30 19:26:09 +02:00
parent fdafdf147a
commit 437ebb69d4
2 changed files with 24 additions and 11 deletions
+21 -10
View File
@@ -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 */