billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=4e1beca3f8497940bf96de48a7daece84c4cf1ef

commit 4e1beca3f8497940bf96de48a7daece84c4cf1ef
Author: Boris Faure <[email protected]>
Date:   Mon Mar 19 23:24:31 2018 +0100

    termptyesc: handle Horizontal Position Absolute (HPA)
---
 src/bin/termptyesc.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

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

-- 


Reply via email to