comparison mcabber/mcabber/screen.c @ 1969:d9255c408027

Improve (fix) buffer up 1 when the screen is cleared
author Mikael Berthe <mikael@lilotux.net>
date Fri, 18 Mar 2011 19:48:34 +0100
parents 83d7c7daea6a
children acbebd68c7f0
comparison
equal deleted inserted replaced
1968:83d7c7daea6a 1969:d9255c408027
2619 nbl = nblines; 2619 nbl = nblines;
2620 } 2620 }
2621 hbuf_top = win_entry->bd->top; 2621 hbuf_top = win_entry->bd->top;
2622 2622
2623 if (updown == -1) { // UP 2623 if (updown == -1) { // UP
2624 n = 0;
2624 if (!hbuf_top) { 2625 if (!hbuf_top) {
2625 hbuf_top = g_list_last(win_entry->bd->hbuf); 2626 hbuf_top = g_list_last(win_entry->bd->hbuf);
2626 if (!win_entry->bd->cleared) { 2627 if (!win_entry->bd->cleared) {
2627 if (!nblines) nbl = nbl*3 - 1; 2628 if (!nblines) nbl = nbl*3 - 1;
2628 else nbl += CHAT_WIN_HEIGHT - 1; 2629 else nbl += CHAT_WIN_HEIGHT - 1;
2629 } else { 2630 } else {
2630 win_entry->bd->cleared = FALSE; 2631 win_entry->bd->cleared = FALSE;
2632 n++; // We'll scroll one line less
2631 } 2633 }
2632 } 2634 }
2633 for (n=0 ; hbuf_top && n < nbl && g_list_previous(hbuf_top) ; n++) 2635 for ( ; hbuf_top && n < nbl && g_list_previous(hbuf_top) ; n++)
2634 hbuf_top = g_list_previous(hbuf_top); 2636 hbuf_top = g_list_previous(hbuf_top);
2635 win_entry->bd->top = hbuf_top; 2637 win_entry->bd->top = hbuf_top;
2636 } else { // DOWN 2638 } else { // DOWN
2637 for (n=0 ; hbuf_top && n < nbl ; n++) 2639 for (n=0 ; hbuf_top && n < nbl ; n++)
2638 hbuf_top = g_list_next(hbuf_top); 2640 hbuf_top = g_list_next(hbuf_top);