Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2018 01:34:40 +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@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 225096
           Summary: [PATCH] Add reverse wrap around to libteken
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: florian_kaiser@genua.de
          Keywords: patch

We needed the reverse wrap around in the teken library and I thought you mi=
ght
like it as well.

Cheers!



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 01:50:08.108822290 +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;

--=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>