From bd858e3aaef6eb1d44e854d155e6d4d0ff464d89 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 29 May 2000 18:35:13 +0000 Subject: [PATCH] Fix the TAB not cause scrolling when entered at the end of the last line. It may cause misterious chars appearse in the middle of the scrolled lines. The bug trigger: enter grep P_32 /usr/include/*.h command and see misterious "db.\" filename. --- sys/dev/syscons/sctermvar.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/dev/syscons/sctermvar.h b/sys/dev/syscons/sctermvar.h index 2ef75f06915..e93699205ba 100644 --- a/sys/dev/syscons/sctermvar.h +++ b/sys/dev/syscons/sctermvar.h @@ -269,9 +269,14 @@ sc_term_tab(scr_stat *scp, int n) if (n < 1) n = 1; i = (scp->xpos & ~7) + 8*n; - if (i >= scp->xsize) - sc_move_cursor(scp, 0, scp->ypos + 1); - else + if (i >= scp->xsize) { + if (scp->ypos >= scp->ysize - 1) { + scp->xpos = 0; + scp->ypos++; + scp->cursor_pos = scp->ypos*scp->xsize; + } else + sc_move_cursor(scp, 0, scp->ypos + 1); + } else sc_move_cursor(scp, i, scp->ypos); } -- 2.45.2