From 9cc0c8c799eedd118243b9918c9db57f9f085e15 Mon Sep 17 00:00:00 2001 From: Mikael Berthe Date: Fri, 18 Mar 2011 19:48:34 +0100 Subject: [PATCH] Improve (fix) buffer up 1 when the screen is cleared --- mcabber/mcabber/screen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mcabber/mcabber/screen.c b/mcabber/mcabber/screen.c index ef088de..f1aae82 100644 --- a/mcabber/mcabber/screen.c +++ b/mcabber/mcabber/screen.c @@ -2621,6 +2621,7 @@ void scr_buffer_scroll_up_down(int updown, unsigned int nblines) hbuf_top = win_entry->bd->top; if (updown == -1) { // UP + n = 0; if (!hbuf_top) { hbuf_top = g_list_last(win_entry->bd->hbuf); if (!win_entry->bd->cleared) { @@ -2628,9 +2629,10 @@ void scr_buffer_scroll_up_down(int updown, unsigned int nblines) else nbl += CHAT_WIN_HEIGHT - 1; } else { win_entry->bd->cleared = FALSE; + n++; // We'll scroll one line less } } - for (n=0 ; hbuf_top && n < nbl && g_list_previous(hbuf_top) ; n++) + for ( ; hbuf_top && n < nbl && g_list_previous(hbuf_top) ; n++) hbuf_top = g_list_previous(hbuf_top); win_entry->bd->top = hbuf_top; } else { // DOWN -- 2.11.4.GIT