Fix paging.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-12-24 23:37:38 +01:00
parent abd1cab3d9
commit 6d305d4f7d
2 changed files with 5 additions and 9 deletions

View file

@ -34,10 +34,6 @@ void (*grub_newline_hook) (void) = NULL;
void void
grub_putcode (grub_uint32_t code, struct grub_term_output *term) grub_putcode (grub_uint32_t code, struct grub_term_output *term)
{ {
int height;
height = grub_term_height (term);
if (code == '\t' && term->getxy) if (code == '\t' && term->getxy)
{ {
int n; int n;
@ -62,7 +58,7 @@ grub_putchar (int c)
static grub_size_t size = 0; static grub_size_t size = 0;
static grub_uint8_t buf[6]; static grub_uint8_t buf[6];
grub_uint32_t code; grub_uint32_t code;
grub_ssize_t ret; grub_size_t ret;
buf[size++] = c; buf[size++] = c;
ret = grub_utf8_to_ucs4 (&code, 1, buf, size, 0); ret = grub_utf8_to_ucs4 (&code, 1, buf, size, 0);
@ -73,9 +69,9 @@ grub_putchar (int c)
size = 0; size = 0;
FOR_ACTIVE_TERM_OUTPUTS(term) FOR_ACTIVE_TERM_OUTPUTS(term)
grub_putcode (code, term); grub_putcode (code, term);
if (code == '\n' && grub_newline_hook)
grub_newline_hook ();
} }
if (ret == '\n' && grub_newline_hook)
grub_newline_hook ();
} }
int int

View file

@ -37,7 +37,7 @@ process_newline (void)
height = grub_term_height (cur); height = grub_term_height (cur);
grub_more_lines++; grub_more_lines++;
if (grub_more && grub_more_lines == height - 1) if (grub_more && grub_more_lines >= height - 1)
{ {
char key; char key;
grub_uint16_t *pos; grub_uint16_t *pos;
@ -57,7 +57,7 @@ process_newline (void)
/* Scroll one lines or an entire page, depending on the key. */ /* Scroll one lines or an entire page, depending on the key. */
if (key == '\r' || key =='\n') if (key == '\r' || key =='\n')
grub_more_lines--; grub_more_lines = height - 2;
else else
grub_more_lines = 0; grub_more_lines = 0;
} }