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.
This commit is contained in:
parent
6c099e834c
commit
bd858e3aae
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user