From 51f836feb81e8021dda0b67d4efcd56d635f8f5d Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 26 Apr 2011 12:39:35 +0200 Subject: core: fix scroll on buffers with free content --- src/gui/gui-window.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gui/gui-window.c') diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c index 55d667997..f8deb1af6 100644 --- a/src/gui/gui-window.c +++ b/src/gui/gui-window.c @@ -800,7 +800,8 @@ gui_window_scroll (struct t_gui_window *window, char *scroll) window->scroll->start_line : window->buffer->lines->last_line; while (ptr_line && (!gui_line_is_displayed (ptr_line) - || (ptr_line->data->date == 0))) + || ((window->buffer->type == GUI_BUFFER_TYPE_FORMATTED) + && (ptr_line->data->date == 0)))) { ptr_line = ptr_line->prev_line; } @@ -811,7 +812,8 @@ gui_window_scroll (struct t_gui_window *window, char *scroll) window->scroll->start_line : window->buffer->lines->first_line; while (ptr_line && (!gui_line_is_displayed (ptr_line) - || (ptr_line->data->date == 0))) + || ((window->buffer->type == GUI_BUFFER_TYPE_FORMATTED) + && (ptr_line->data->date == 0)))) { ptr_line = ptr_line->next_line; } @@ -829,7 +831,9 @@ gui_window_scroll (struct t_gui_window *window, char *scroll) ptr_line = (direction < 0) ? gui_line_get_prev_displayed (ptr_line) : gui_line_get_next_displayed (ptr_line); - if (ptr_line && (ptr_line->data->date != 0)) + if (ptr_line + && ((window->buffer->type != GUI_BUFFER_TYPE_FORMATTED) + || (ptr_line->data->date != 0))) { if (time_letter == ' ') { -- cgit v1.2.3