diff options
-rw-r--r-- | editors/vi.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/editors/vi.c b/editors/vi.c index 01597fa5e..adfb2b87c 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -3047,12 +3047,15 @@ static int find_range(char **start, char **stop, char c) | |||
3047 | do_cmd(c); // execute movement cmd | 3047 | do_cmd(c); // execute movement cmd |
3048 | dot_end(); // find NL | 3048 | dot_end(); // find NL |
3049 | q = dot; | 3049 | q = dot; |
3050 | } else { | 3050 | } else /* if (c == ' ' || c == 'l') */ { |
3051 | // nothing -- this causes any other values of c to | 3051 | // forward motion by character |
3052 | // represent the one-character range under the | 3052 | int tmpcnt = (cmdcnt ?: 1); |
3053 | // cursor. this is correct for ' ' and 'l', but | 3053 | do_cmd(c); // execute movement cmd |
3054 | // perhaps no others. | 3054 | // exclude last char unless range isn't what we expected |
3055 | // | 3055 | // this indicates we've hit EOL |
3056 | if (tmpcnt == dot - p) | ||
3057 | dot--; | ||
3058 | q = dot; | ||
3056 | } | 3059 | } |
3057 | if (q < p) { | 3060 | if (q < p) { |
3058 | t = q; | 3061 | t = q; |