aboutsummaryrefslogtreecommitdiff
path: root/sys/teken/teken_subr.h
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-11-11 08:11:21 +0000
committerEd Schouten <ed@FreeBSD.org>2009-11-11 08:11:21 +0000
commit0475bba7f5d9ff73cc59c9a734e88f31eb0ec11a (patch)
tree301185878b8ad64f9f76a1fa9ab544fccd91c4f6 /sys/teken/teken_subr.h
parentb201cde68de6594252589ffdc19565c9629dd242 (diff)
downloadsrc-0475bba7f5d9ff73cc59c9a734e88f31eb0ec11a.tar.gz
src-0475bba7f5d9ff73cc59c9a734e88f31eb0ec11a.zip
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.
Notes
Notes: svn path=/head/; revision=199170
Diffstat (limited to 'sys/teken/teken_subr.h')
-rw-r--r--sys/teken/teken_subr.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/teken/teken_subr.h b/sys/teken/teken_subr.h
index ad10abbb6fd5..4caa5007358a 100644
--- a/sys/teken/teken_subr.h
+++ b/sys/teken/teken_subr.h
@@ -1237,16 +1237,17 @@ teken_subr_set_top_and_bottom_margins(teken_t *t, unsigned int top,
bottom = t->t_winsize.tp_row;
}
+ /* Apply scrolling region. */
t->t_scrollreg.ts_begin = top;
t->t_scrollreg.ts_end = bottom;
- if (t->t_stateflags & TS_ORIGIN) {
- /* XXX: home cursor? */
+ if (t->t_stateflags & TS_ORIGIN)
t->t_originreg = t->t_scrollreg;
- t->t_cursor.tp_row = t->t_originreg.ts_begin;
- t->t_cursor.tp_col = 0;
- t->t_stateflags &= ~TS_WRAPPED;
- teken_funcs_cursor(t);
- }
+
+ /* Home cursor to the top left of the scrolling region. */
+ t->t_cursor.tp_row = t->t_originreg.ts_begin;
+ t->t_cursor.tp_col = 0;
+ t->t_stateflags &= ~TS_WRAPPED;
+ teken_funcs_cursor(t);
}
static void