aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-17 11:29:52 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-17 11:29:52 +0000
commit7f4b2c57558c7d96e783ad1be6046df41b547463 (patch)
tree6ab26892c2652690da826af2661b5cd56e2df6ff
parentvt: replace pre_print() with term_autowrap() (diff)
csi: implement 'CHT' - Cursor Horizontal Tab
-rw-r--r--csi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/csi.c b/csi.c
index c3a7573c..012af5d6 100644
--- a/csi.c
+++ b/csi.c
@@ -624,6 +624,22 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
}
+ case 'I': {
+ /* CHT - Tab Forward (param is number of tab stops to move through) */
+ for (int i = 0; i < vt_param_get(term, 0, 1); i++) {
+ int new_col = term->cols - 1;
+ tll_foreach(term->tab_stops, it) {
+ if (it->item > term->cursor.point.col) {
+ new_col = it->item;
+ break;
+ }
+ }
+ assert(new_col >= term->cursor.point.col);
+ term_cursor_right(term, new_col - term->cursor.point.col);
+ }
+ break;
+ }
+
case 'Z':
/* CBT - Back tab (param is number of tab stops to move back through) */
for (int i = 0; i < vt_param_get(term, 0, 1); i++) {