summaryrefslogtreecommitdiffstats
path: root/sys/teken
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-09-25 11:58:51 +0000
committered <ed@FreeBSD.org>2009-09-25 11:58:51 +0000
commitf832106f993304abc844167339fbf5ccd40014c0 (patch)
tree044b4ca03fe1c3d217d7da7b67c1d55dc7e40d0d /sys/teken
parent345997867111c164544ebbb384e7fad71391eabe (diff)
downloadFreeBSD-src-f832106f993304abc844167339fbf5ccd40014c0.zip
FreeBSD-src-f832106f993304abc844167339fbf5ccd40014c0.tar.gz
Conformance: ignore {delete,insert} line while outside the scrolling region.
I noticed a small inconsistency in delete and insert line between xterm and libteken. libteken allows these actions to happen while the cursor is placed outside the scrolling region, while xterm does not. This behaviour seems to be VT100-like. Confirmation: http://www.vt100.net/docs/vt102-ug/chapter5.html "This sequence is ignored when cursor is outside scrolling region." MFC after: 1 month
Diffstat (limited to 'sys/teken')
-rw-r--r--sys/teken/teken_subr.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/teken/teken_subr.h b/sys/teken/teken_subr.h
index 9e84b9c..7d8cd0c 100644
--- a/sys/teken/teken_subr.h
+++ b/sys/teken/teken_subr.h
@@ -397,6 +397,11 @@ teken_subr_delete_line(teken_t *t, unsigned int nrows)
{
teken_rect_t tr;
+ /* Ignore if outside scrolling region. */
+ if (t->t_cursor.tp_row < t->t_scrollreg.ts_begin ||
+ t->t_cursor.tp_row >= t->t_scrollreg.ts_end)
+ return;
+
tr.tr_begin.tp_col = 0;
tr.tr_end.tp_row = t->t_scrollreg.ts_end;
tr.tr_end.tp_col = t->t_winsize.tp_col;
@@ -656,6 +661,11 @@ teken_subr_insert_line(teken_t *t, unsigned int nrows)
{
teken_rect_t tr;
+ /* Ignore if outside scrolling region. */
+ if (t->t_cursor.tp_row < t->t_scrollreg.ts_begin ||
+ t->t_cursor.tp_row >= t->t_scrollreg.ts_end)
+ return;
+
tr.tr_begin.tp_row = t->t_cursor.tp_row;
tr.tr_begin.tp_col = 0;
tr.tr_end.tp_col = t->t_winsize.tp_col;
OpenPOWER on IntegriCloud