tvi: space and backspace should not change the line - 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 3472b9c90eea860d3aff4e9c555fbaab6f4f90bf
 (DIR) parent 6831be74582cbec67c8fcba98df286fbf8839015
 (HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
       Date:   Sat,  9 May 2015 00:10:39 +0430
       
       vi: space and backspace should not change the line
       
       Diffstat:
         M vi.c                                |       7 +++----
       
       1 file changed, 3 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/vi.c b/vi.c
       t@@ -264,7 +264,7 @@ static int vi_motion(int *row, int *col, int pre1, int pre2)
                switch (c) {
                case ' ':
                        for (i = 0; i < pre; i++)
       -                        if (lbuf_next(xb, row, col, 1))
       +                        if (lbuf_lnnext(xb, row, col, 1))
                                        break;
                        break;
                case 'f':
       t@@ -334,9 +334,8 @@ static int vi_motion(int *row, int *col, int pre1, int pre2)
                        break;
                case 127:
                case TERMCTRL('h'):
       -                *col = ren_cursor(ln, *col);
                        for (i = 0; i < pre; i++)
       -                        if (lbuf_next(xb, row, col, -1))
       +                        if (lbuf_lnnext(xb, row, col, -1))
                                        break;
                        break;
                default:
       t@@ -700,7 +699,7 @@ static void vi(void)
                                        redraw = 1;
                                        break;
                                case 'X':
       -                                vi_back('h');
       +                                vi_back(TERMCTRL('h'));
                                        vc_motion('d', pre1);
                                        redraw = 1;
                                        break;