Always home the cursor when changing the scrolling region.
I thought this only had to be done when in origin mode, to ensure that the cursor is not placed outside the origin, but it seems this is also done when not in origin mode. This fixes some artifacts when pressing ^L while running irssi in tmux. (Almost) nobody noticed this, because cons25 doesn't have scrolling regions.
This commit is contained in:
parent
b201cde68d
commit
0475bba7f5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=199170
@ -1237,16 +1237,17 @@ teken_subr_set_top_and_bottom_margins(teken_t *t, unsigned int top,
|
|||||||
bottom = t->t_winsize.tp_row;
|
bottom = t->t_winsize.tp_row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Apply scrolling region. */
|
||||||
t->t_scrollreg.ts_begin = top;
|
t->t_scrollreg.ts_begin = top;
|
||||||
t->t_scrollreg.ts_end = bottom;
|
t->t_scrollreg.ts_end = bottom;
|
||||||
if (t->t_stateflags & TS_ORIGIN) {
|
if (t->t_stateflags & TS_ORIGIN)
|
||||||
/* XXX: home cursor? */
|
|
||||||
t->t_originreg = t->t_scrollreg;
|
t->t_originreg = t->t_scrollreg;
|
||||||
t->t_cursor.tp_row = t->t_originreg.ts_begin;
|
|
||||||
t->t_cursor.tp_col = 0;
|
/* Home cursor to the top left of the scrolling region. */
|
||||||
t->t_stateflags &= ~TS_WRAPPED;
|
t->t_cursor.tp_row = t->t_originreg.ts_begin;
|
||||||
teken_funcs_cursor(t);
|
t->t_cursor.tp_col = 0;
|
||||||
}
|
t->t_stateflags &= ~TS_WRAPPED;
|
||||||
|
teken_funcs_cursor(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user