Properly use the cursor to bound the position for CUP.

We must take the origin region into account when clamping the cursor
position.

MFC after:	3 days
This commit is contained in:
Ed Schouten 2011-10-10 06:13:27 +00:00
parent 3c5ebcdc1d
commit 231c19b1e3

View file

@ -325,7 +325,7 @@ teken_subr_cursor_position(teken_t *t, unsigned int row, unsigned int col)
{
t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1;
if (row >= t->t_originreg.ts_end)
if (t->t_cursor.tp_row >= t->t_originreg.ts_end)
t->t_cursor.tp_row = t->t_originreg.ts_end - 1;
t->t_cursor.tp_col = col - 1;