billiob pushed a commit to branch master.

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

commit f7576fb01c1a9dac77063669f3f65b1d01b2666b
Author: Boris Faure <[email protected]>
Date:   Tue Jan 1 20:32:45 2019 +0100

    termptyesc: move CHT handler to its own function
---
 src/bin/termptyesc.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 8c1d5a3..eb26b88 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -2480,6 +2480,19 @@ _handle_esc_csi_cha(Termpty *ty, Eina_Unicode **ptr)
    TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, min, max);
 }
 
+static void
+_handle_esc_csi_cht(Termpty *ty, Eina_Unicode **ptr)
+{
+   Eina_Unicode *b = *ptr;
+   int arg = _csi_arg_get(ty, &b);
+
+   if (arg == -CSI_ARG_ERROR)
+     return;
+   TERMPTY_RESTRICT_FIELD(arg, 1, ty->w);
+   DBG("CHT - Cursor Forward Tabulation: %d", arg);
+   _tab_forward(ty, arg);
+}
+
 static int
 _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
 {
@@ -2540,12 +2553,7 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, 
const Eina_Unicode *ce)
         _handle_esc_csi_cursor_pos_set(ty, &b, cc);
         break;
       case 'I':
-        arg = _csi_arg_get(ty, &b);
-        if (arg == -CSI_ARG_ERROR)
-          goto error;
-        TERMPTY_RESTRICT_FIELD(arg, 1, ty->w);
-        DBG("Cursor Forward Tabulation (CHT): %d", arg);
-        _tab_forward(ty, arg);
+        _handle_esc_csi_cht(ty, &b);
         break;
       case 'J':
         if (*b == '?')

-- 


Reply via email to