[BusyBox-cvs] svn commit: trunk/busybox/editors

pgf at busybox.net pgf at busybox.net
Mon Jul 18 22:17:26 UTC 2005


Author: pgf
Date: 2005-07-18 16:17:25 -0600 (Mon, 18 Jul 2005)
New Revision: 10851

Log:
allow both ^H and DEL to backspace in insert mode (bug #23)


Modified:
   trunk/busybox/editors/vi.c


Changeset:
Modified: trunk/busybox/editors/vi.c
===================================================================
--- trunk/busybox/editors/vi.c	2005-07-18 20:06:49 UTC (rev 10850)
+++ trunk/busybox/editors/vi.c	2005-07-18 22:17:25 UTC (rev 10851)
@@ -1612,7 +1612,7 @@
 		if ((p[-1] != '\n') && (dot>text)) {
 			p--;
 		}
-	} else if (c == erase_char) {	// Is this a BS
+	} else if (c == erase_char || c == 8 || c == 127) { // Is this a BS
 		//     123456789
 		if ((p[-1] != '\n') && (dot>text)) {
 			p--;
@@ -3083,8 +3083,8 @@
 		break;
 	case 'h':			// h- move left
 	case VI_K_LEFT:	// cursor key Left
-	case 8:			// ctrl-H- move left    (This may be ERASE char)
-	case 127:			// DEL- move left   (This may be ERASE char)
+	case 8:		// ctrl-H- move left    (This may be ERASE char)
+	case 127:	// DEL- move left   (This may be ERASE char)
 		if (cmdcnt-- > 1) {
 			do_cmd(c);
 		}				// repeat cnt
@@ -3249,7 +3249,7 @@
 		//
 		// dont separate these two commands. 'f' depends on ';'
 		//
-		//**** fall thru to ... 'i'
+		//**** fall thru to ... ';'
 	case ';':			// ;- look at rest of line for last forward char
 		if (cmdcnt-- > 1) {
 			do_cmd(';');




More information about the busybox-cvs mailing list