From b575a4f578dd5f2b356a731dd58a14cb21e7f2e1 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 4 Nov 2005 16:14:28 +0000 Subject: [PATCH] Fixed scroll problem when one line is bigger than screen size --- ChangeLog | 1 + src/gui/curses/gui-display.c | 8 ++++---- weechat/ChangeLog | 1 + weechat/src/gui/curses/gui-display.c | 8 ++++---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94019d019..72e002a77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ Version 0.1.6 (under dev!): * new color management system, IRC colors are now correctly displayed and can be removed by new options irc_colors_receive and irc_colors_send + * fixed scroll problem when one line is bigger than screen size * added setting for having one server buffer for all servers (look_one_server_buffer) * added setting for ignoring some chars when completing nicks diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index 9addeeab0..07ddc6220 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -1013,7 +1013,7 @@ gui_display_word (t_gui_window *window, int pos_saved_char, chars_to_display, num_displayed; if (!data || - ((!simulate) && (window->win_chat_cursor_y > window->win_chat_height - 1))) + ((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height))) return; end_line = data + strlen (data); @@ -1082,7 +1082,7 @@ gui_display_word (t_gui_window *window, lines_displayed, simulate); if ((data >= end_line) || - (window->win_chat_cursor_y >= window->win_chat_height)) + ((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height))) data = NULL; } @@ -1237,7 +1237,7 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat ptr_end_offset, num_lines, count, &lines_displayed, simulate); - if (window->win_chat_cursor_y >= window->win_chat_height) + if ((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height)) ptr_data = NULL; else { @@ -1548,7 +1548,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) } else { - /* look for first line to display, sarting from last line */ + /* look for first line to display, starting from last line */ ptr_line = NULL; line_pos = 0; gui_calculate_line_diff (ptr_win, &ptr_line, &line_pos, diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 94019d019..72e002a77 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -8,6 +8,7 @@ Version 0.1.6 (under dev!): * new color management system, IRC colors are now correctly displayed and can be removed by new options irc_colors_receive and irc_colors_send + * fixed scroll problem when one line is bigger than screen size * added setting for having one server buffer for all servers (look_one_server_buffer) * added setting for ignoring some chars when completing nicks diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index 9addeeab0..07ddc6220 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -1013,7 +1013,7 @@ gui_display_word (t_gui_window *window, int pos_saved_char, chars_to_display, num_displayed; if (!data || - ((!simulate) && (window->win_chat_cursor_y > window->win_chat_height - 1))) + ((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height))) return; end_line = data + strlen (data); @@ -1082,7 +1082,7 @@ gui_display_word (t_gui_window *window, lines_displayed, simulate); if ((data >= end_line) || - (window->win_chat_cursor_y >= window->win_chat_height)) + ((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height))) data = NULL; } @@ -1237,7 +1237,7 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat ptr_end_offset, num_lines, count, &lines_displayed, simulate); - if (window->win_chat_cursor_y >= window->win_chat_height) + if ((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height)) ptr_data = NULL; else { @@ -1548,7 +1548,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) } else { - /* look for first line to display, sarting from last line */ + /* look for first line to display, starting from last line */ ptr_line = NULL; line_pos = 0; gui_calculate_line_diff (ptr_win, &ptr_line, &line_pos,