Restrict ctrl-w to last word
authorSimon Andersson <simon.andersson@magine.com>
Wed, 22 Jul 2015 21:30:03 +0000 (23:30 +0200)
committerSimon Andersson <simon.andersson@magine.com>
Wed, 22 Jul 2015 21:30:03 +0000 (23:30 +0200)
Doesn't work in the middle of a line currently

src/curses/ux_input.c

index 9f1367aed9b73abc2c7c1895b534893d1cf1cccc..c05cd5ae476b8d2902f484401411e71cf6dee81d 100644 (file)
@@ -449,7 +449,7 @@ zchar os_read_line (int max, zchar *buf, int timeout, int width, int continued)
            }
            break;
        case ZC_DEL_WORD:
-               if (scrpos != 0) {
+               if (scrpos != 0 && scrpos == len) {
                        /* Search for start of preceding word */
                        int i = len;
                        while (i > 0 && buf[i] != ' ') {