billiob pushed a commit to branch terminology-1.1.

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

commit 7c358c3592f01346d555c38daf01f34bcda9f545
Author: Boris Faure <bill...@gmail.com>
Date:   Tue Aug 22 20:51:20 2017 +0200

    termptyesc: correctly handle going to start of line when there is a  left 
margin
---
 src/bin/termptyesc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index d2ca4fd..c71a893 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -151,6 +151,12 @@ _tab_forward(Termpty *ty, int n)
 }
 
 static void
+_cursor_to_start_of_line(Termpty *ty)
+{
+   ty->cursor_state.cx = ty->termstate.left_margin;
+}
+
+static void
 _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
 {
    switch (*cc)
@@ -173,7 +179,8 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
       case 0x0c: // FF  '\f' (form feed)
          DBG("->LF");
          ty->termstate.wrapnext = 0;
-         if (ty->termstate.crlf) ty->cursor_state.cx = 0;
+         if (ty->termstate.crlf)
+           _cursor_to_start_of_line(ty);
          ty->cursor_state.cy++;
          termpty_text_scroll_test(ty, EINA_TRUE);
          return;
@@ -185,7 +192,7 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
               ty->termstate.had_cr_y = ty->cursor_state.cy;
               ty->termstate.wrapnext = 0;
            }
-         ty->cursor_state.cx = 0;
+         _cursor_to_start_of_line(ty);
          return;
       default:
          return;

-- 


Reply via email to