[BusyBox-cvs] busybox/editors vi.c,1.30,1.31

Glenn McGrath bug1 at busybox.net
Wed Jan 21 10:59:48 UTC 2004


Update of /var/cvs/busybox/editors
In directory nail:/tmp/cvs-serv22884/editors

Modified Files:
	vi.c 
Log Message:
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 


Index: vi.c
===================================================================
RCS file: /var/cvs/busybox/editors/vi.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- vi.c	23 Dec 2003 20:45:14 -0000	1.30
+++ vi.c	21 Jan 2004 10:59:45 -0000	1.31
@@ -1669,7 +1669,9 @@
 		q = dot;
 	} else if (strchr("wW", c)) {
 		do_cmd(c);		// execute movement cmd
-		if (dot > text)
+		// if we are at the next word's first char
+		// step back one char
+		if (dot > text && isspace(dot[-1]))
 			dot--;		// move back off of next word
 		if (dot > text && *dot == '\n')
 			dot--;		// stay off NL
@@ -3195,7 +3197,7 @@
 		if (cmdcnt-- > 1) {
 			do_cmd(c);
 		}				// repeat cnt
-		dot = end_line(dot + 1);
+		dot = end_line(dot);
 		break;
 	case '%':			// %- find matching char of pair () [] {}
 		for (q = dot; q < end && *q != '\n'; q++) {




More information about the busybox-cvs mailing list