vi: fix [end] key handling
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 28 Nov 2011 03:55:48 +0000 (04:55 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 28 Nov 2011 03:55:48 +0000 (04:55 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/vi.c

index 71d600834060ccfd12bec371e97460557d9dbffd..6070c48d26d1f283f8aee16af53d4e2835d852f8 100644 (file)
@@ -3319,7 +3319,7 @@ static void do_cmd(int c)
        case KEYCODE_END:               // Cursor Key End
                for (;;) {
                        dot = end_line(dot);
-                       if (--cmdcnt > 0)
+                       if (--cmdcnt <= 0)
                                break;
                        dot_next();
                }