From 38d8921603b41a22aa8736d20214608c268805f5 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 12 Oct 2011 09:28:09 +0000 Subject: [PATCH] MFC r226099: Tab should not blank cells. It seems I was under the impression that a tab differs from a single forward tabulation, namely that it blanks the underlying cells. This seems not to be the case. They are identical. This should fix applications like jove(1) that use tabs instead of explicit cursor position setting. Reported by: Brett Glass MFC r226183: Properly use the cursor to bound the position for CUP. We must take the origin region into account when clamping the cursor position. Approved by: re@ (kib) git-svn-id: svn://svn.freebsd.org/base/stable/9@226295 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/teken/teken_subr.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sys/teken/teken_subr.h b/sys/teken/teken_subr.h index f4c78f4ed..64f4e5456 100644 --- a/sys/teken/teken_subr.h +++ b/sys/teken/teken_subr.h @@ -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; @@ -595,20 +595,7 @@ static void teken_subr_horizontal_tab(teken_t *t) { - if (t->t_stateflags & TS_CONS25) { - teken_subr_cursor_forward_tabulation(t, 1); - } else { - teken_rect_t tr; - - tr.tr_begin = t->t_cursor; - teken_subr_cursor_forward_tabulation(t, 1); - tr.tr_end.tp_row = tr.tr_begin.tp_row + 1; - tr.tr_end.tp_col = t->t_cursor.tp_col; - - /* Blank region that we skipped. */ - if (tr.tr_end.tp_col > tr.tr_begin.tp_col) - teken_funcs_fill(t, &tr, BLANK, &t->t_curattr); - } + teken_subr_cursor_forward_tabulation(t, 1); } static void -- 2.45.0