aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-03-19 23:24:31 +0100
committerBoris Faure <billiob@gmail.com>2018-03-19 23:24:31 +0100
commit4e1beca3f8497940bf96de48a7daece84c4cf1ef (patch)
tree0d967ea3b38165b23e89cbb076bbca673cfe7736
parenttermio: force refocus after ctx popup is deleted. Closes T6782 (diff)
downloadterminology-4e1beca3f8497940bf96de48a7daece84c4cf1ef.tar.gz
termptyesc: handle Horizontal Position Absolute (HPA)
-rw-r--r--src/bin/termptyesc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 85bf1bd..660eaf5 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -1518,6 +1518,28 @@ CUF:
TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 0, ty->w);
}
break;
+ case '`': // HPA
+ arg = _csi_arg_get(&b);
+ DBG("Horizontal Position Absolute (HPA): %d", arg);
+ arg--;
+ if (arg < 0) arg = 0;
+ ty->termstate.wrapnext = 0;
+ ty->cursor_state.cx = arg;
+ TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 0, ty->w);
+ if (ty->termstate.restrict_cursor)
+ {
+ if ((ty->termstate.right_margin != 0)
+ && (ty->cursor_state.cx >= ty->termstate.right_margin))
+ {
+ ty->cursor_state.cx = ty->termstate.right_margin - 1;
+ }
+ if ((ty->termstate.left_margin != 0)
+ && (ty->cursor_state.cx < ty->termstate.left_margin))
+ {
+ ty->cursor_state.cx = ty->termstate.left_margin;
+ }
+ }
+ break;
case 'a': // cursor right N
goto CUF;
case 'b': // repeat last char