diff options
author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-08-29 19:59:43 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-08-29 19:59:43 +0200 |
commit | 93901ca4fee8a1ab71cb8b918f3d65404460f9ce (patch) | |
tree | dca9c5766a56ef85b8047b624c76b58927289503 | |
parent | ee7fd748ac7bfabda2ac37251d230b45adb3e138 (diff) | |
download | st-93901ca4fee8a1ab71cb8b918f3d65404460f9ce.tar.gz st-93901ca4fee8a1ab71cb8b918f3d65404460f9ce.zip |
Add HTS sequence
This sequence adds a new tab stop in the current horizontal position. This
means that tputtab must be look for the next tab stop in the tabs array
instead of using a hard coded value offset. Also, CHT sequence XXX message
is removed because it is not a vt10x sequence (as far as I know it is a
vt50x sequence), and it is not implemented by linux virtual terminal neither
by xterm.
Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
---
st.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
-rw-r--r-- | st.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1214,7 +1214,6 @@ csihandle(void) { | |||
1214 | DEFAULT(escseq.arg[1], 1); | 1214 | DEFAULT(escseq.arg[1], 1); |
1215 | tmoveto(escseq.arg[1]-1, escseq.arg[0]-1); | 1215 | tmoveto(escseq.arg[1]-1, escseq.arg[0]-1); |
1216 | break; | 1216 | break; |
1217 | /* XXX: (CSI n I) CHT -- Cursor Forward Tabulation <n> tab stops */ | ||
1218 | case 'J': /* ED -- Clear screen */ | 1217 | case 'J': /* ED -- Clear screen */ |
1219 | sel.bx = -1; | 1218 | sel.bx = -1; |
1220 | switch(escseq.arg[0]) { | 1219 | switch(escseq.arg[0]) { |
@@ -1429,8 +1428,11 @@ csireset(void) { | |||
1429 | 1428 | ||
1430 | void | 1429 | void |
1431 | tputtab(void) { | 1430 | tputtab(void) { |
1432 | int space = TAB - term.c.x % TAB; | 1431 | unsigned x; |
1433 | tmoveto(term.c.x + space, term.c.y); | 1432 | |
1433 | for (x = term.c.x + 1; x < term.col && !term.tabs[x]; ++x) | ||
1434 | /* nothing */ ; | ||
1435 | tmoveto(x, term.c.y); | ||
1434 | } | 1436 | } |
1435 | 1437 | ||
1436 | void | 1438 | void |
@@ -1491,6 +1493,10 @@ tputc(char *c) { | |||
1491 | tnewline(1); /* always go to first col */ | 1493 | tnewline(1); /* always go to first col */ |
1492 | term.esc = 0; | 1494 | term.esc = 0; |
1493 | break; | 1495 | break; |
1496 | case 'H': /* HTS -- Horizontal tab stop */ | ||
1497 | term.tabs[term.c.x] = 1; | ||
1498 | term.esc = 0; | ||
1499 | break; | ||
1494 | case 'M': /* RI -- Reverse index */ | 1500 | case 'M': /* RI -- Reverse index */ |
1495 | if(term.c.y == term.top) | 1501 | if(term.c.y == term.top) |
1496 | tscrolldown(term.top, 1); | 1502 | tscrolldown(term.top, 1); |