aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-01-21 10:59:45 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-01-21 10:59:45 +0000
commitee829065cb7c52e3dfb74b35939ef08b9578a0b5 (patch)
tree744d28c88d5f307fd899b6dd08760fe43e0eb822
parenteaf5bc003839fd5844db4a827b86b621f7084fad (diff)
downloadbusybox-w32-ee829065cb7c52e3dfb74b35939ef08b9578a0b5.tar.gz
busybox-w32-ee829065cb7c52e3dfb74b35939ef08b9578a0b5.tar.bz2
busybox-w32-ee829065cb7c52e3dfb74b35939ef08b9578a0b5.zip
Patch by Richard Kojedzinszky, when using END at end of lines it was
skipping to next line, cw command was leaving one char in buffer
-rw-r--r--editors/vi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 35ce172d6..ac3a175af 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21static const char vi_Version[] = 21static const char vi_Version[] =
22 "$Id: vi.c,v 1.30 2003/12/23 20:45:14 andersen Exp $"; 22 "$Id: vi.c,v 1.31 2004/01/21 10:59:45 bug1 Exp $";
23 23
24/* 24/*
25 * To compile for standalone use: 25 * To compile for standalone use:
@@ -1669,7 +1669,9 @@ static Byte find_range(Byte ** start, Byte ** stop, Byte c)
1669 q = dot; 1669 q = dot;
1670 } else if (strchr("wW", c)) { 1670 } else if (strchr("wW", c)) {
1671 do_cmd(c); // execute movement cmd 1671 do_cmd(c); // execute movement cmd
1672 if (dot > text) 1672 // if we are at the next word's first char
1673 // step back one char
1674 if (dot > text && isspace(dot[-1]))
1673 dot--; // move back off of next word 1675 dot--; // move back off of next word
1674 if (dot > text && *dot == '\n') 1676 if (dot > text && *dot == '\n')
1675 dot--; // stay off NL 1677 dot--; // stay off NL
@@ -3195,7 +3197,7 @@ key_cmd_mode:
3195 if (cmdcnt-- > 1) { 3197 if (cmdcnt-- > 1) {
3196 do_cmd(c); 3198 do_cmd(c);
3197 } // repeat cnt 3199 } // repeat cnt
3198 dot = end_line(dot + 1); 3200 dot = end_line(dot);
3199 break; 3201 break;
3200 case '%': // %- find matching char of pair () [] {} 3202 case '%': // %- find matching char of pair () [] {}
3201 for (q = dot; q < end && *q != '\n'; q++) { 3203 for (q = dot; q < end && *q != '\n'; q++) {