Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2018 11:36:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 225096] [PATCH] Add reverse wrap around to libteken
Message-ID:  <bug-225096-8-Lbezs2pLcY@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-225096-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-225096-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225096

--- Comment #1 from florian_kaiser@genua.de ---
unfortunately I lost some lines in the previous diff...
here is the updated patch:


diff -u -r -N teken/teken.c teken_/teken.c
--- teken/teken.c       2018-01-12 01:48:10.832926321 +0100
+++ teken_/teken.c      2018-01-12 01:50:08.108822290 +0100
@@ -58,6 +58,7 @@
 #define        TS_CONS25       0x0040  /* cons25 emulation. */
 #define        TS_INSTRING     0x0080  /* Inside string. */
 #define        TS_CURSORKEYS   0x0100  /* Cursor keys mode. */
+#define        TS_REVWRAP      0x0200  /* reverse Wraparound */

 /* Character that blanks a cell. */
 #define        BLANK   ' '
diff -u -r -N teken/teken_subr.h teken_/teken_subr.h
--- teken/teken_subr.h  2018-01-12 01:48:10.833926389 +0100
+++ teken_/teken_subr.h 2018-01-12 12:33:37.831931927 +0100
@@ -213,6 +213,16 @@
                } else {
                        t->t_cursor.tp_col--;
                }
+       } else if (t->t_stateflags & TS_REVWRAP)  {
+               if (t->t_cursor.tp_col =3D=3D 0) {
+                       if (t->t_cursor.tp_row =3D=3D t->t_originreg.ts_beg=
in)
+                               return;
+                       t->t_cursor.tp_row--;
+                       t->t_cursor.tp_col =3D t->t_winsize.tp_col - 2;
+               } else {
+                       t->t_cursor.tp_col--;
+                       t->t_stateflags &=3D ~TS_WRAPPED;
+               }
        } else {
                if (t->t_cursor.tp_col =3D=3D 0)
                        return;
@@ -934,7 +944,8 @@
                teken_printf("DECRST allow 132\n");
                break;
        case 45: /* Disable reverse wraparound. */
-               teken_printf("DECRST reverse wraparound\n");
+               t->t_stateflags &=3D ~TS_REVWRAP;
+               teken_printf("DECRST reverse wraparound disabled\n");
                break;
        case 47: /* Switch to alternate buffer. */
                teken_printf("Switch to alternate buffer\n");
@@ -1092,7 +1103,8 @@
                teken_printf("DECSET allow 132\n");
                break;
        case 45: /* Enable reverse wraparound. */
-               teken_printf("DECSET reverse wraparound\n");
+               t->t_stateflags |=3D TS_REVWRAP;
+               teken_printf("DECSET reverse wraparound enabled\n");
                break;
        case 47: /* Switch to alternate buffer. */
                teken_printf("Switch away from alternate buffer\n");

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-225096-8-Lbezs2pLcY>