tvi: basic z scrolling commands - neatvi - [fork] simple vi-type editor with UTF-8 support
 (HTM) git clone git://src.adamsgaard.dk/neatvi
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit f1cad65ba4925b3ce10822dff8565467662d72b4
 (DIR) parent aa607d3ef71740de17207fa9bc4fcd6a8d2eb556
 (HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
       Date:   Wed,  6 May 2015 16:38:24 +0430
       
       vi: basic z scrolling commands
       
       Diffstat:
         M vi.c                                |      20 +++++++++++++++++++-
       
       1 file changed, 19 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/vi.c b/vi.c
       t@@ -536,6 +536,7 @@ static void vi(void)
                                        lbuf_postindents(xb, &xrow, &xcol);
                        } else if (!vi_motion(&xrow, &xcol, pre1, 0)) {
                                int c = vi_read();
       +                        int z;
                                if (c <= 0)
                                        continue;
                                switch (c) {
       t@@ -595,7 +596,24 @@ static void vi(void)
                                        redraw = 1;
                                        break;
                                case 'z':
       -                                xdir = vi_read();
       +                                z = vi_read();
       +                                switch (z) {
       +                                case '\n':
       +                                        xtop = pre1 ? pre1 : xrow;
       +                                        break;
       +                                case '.':
       +                                        xtop = MAX(0, (pre1 ? pre1 : xrow) - xrows / 2);
       +                                        break;
       +                                case '-':
       +                                        xtop = MAX(0, (pre1 ? pre1 : xrow) - xrows + 1);
       +                                        break;
       +                                case 'l':
       +                                case 'r':
       +                                case 'L':
       +                                case 'R':
       +                                        xdir = z;
       +                                        break;
       +                                }
                                        redraw = 1;
                                        break;
                                default: