[Bug 225096] [PATCH] Add reverse wrap around to libteken

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jan 12 01:34:40 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225096

            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 at FreeBSD.org
          Reporter: florian_kaiser at genua.de
          Keywords: patch

We needed the reverse wrap around in the teken library and I thought you might
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 == 0) {
+                       if (t->t_cursor.tp_row == t->t_originreg.ts_begin)
+                               return;
+                       t->t_cursor.tp_row--;
+                       t->t_cursor.tp_col = t->t_winsize.tp_col - 2;
+               } else {
+                       t->t_cursor.tp_col--;
+                       t->t_stateflags &= ~TS_WRAPPED;
+               }
        } else {
                if (t->t_cursor.tp_col == 0)
                        return;

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


More information about the freebsd-bugs mailing list