Console command line editing

Ann and Jason Edmeades us at the-edmeades.demon.co.uk
Mon Apr 29 16:17:53 CDT 2002


Fixes to make console editing in win32 mode similar to windows:

- Delete key deletes current character
- Ctrl + end deletes to end of line
- Ctrl + right stopped before the word itself

Regards,
Jason

jason  @  the-edmeades.demon.co.uk

Index: editline.c
===================================================================
RCS file: /home/wine/wine/win32/editline.c,v
retrieving revision 1.6
diff -u -u -r1.6 editline.c
--- editline.c	26 Apr 2002 19:05:18 -0000	1.6
+++ editline.c	29 Apr 2002 21:17:08 -0000
@@ -239,8 +239,8 @@
 static int WCEL_GetRightWordTransition(WCEL_Context* ctx, int ofs)
 {
     ofs++;
-    while (ofs <= ctx->len && !WCEL_iswalnum(ctx->line[ofs])) ofs++;
     while (ofs <= ctx->len && WCEL_iswalnum(ctx->line[ofs])) ofs++;
+    while (ofs <= ctx->len && !WCEL_iswalnum(ctx->line[ofs])) ofs++;
     return min(ofs, ctx->len);
 }
 
@@ -615,8 +615,9 @@
     {/*VK_RIGHT*/0x27,	WCEL_MoveRight		},
     {/*VK_HOME*/ 0x24,	WCEL_MoveToBeg 		},
     {/*VK_END*/  0x23,	WCEL_MoveToEnd 		},
-    {/*VK_UP*/   0x26, 	WCEL_MoveToPrevHist 	},
+    {/*VK_UP*/   0x26, 	WCEL_MoveToPrevHist	},
     {/*VK_DOWN*/ 0x28,	WCEL_MoveToNextHist	},
+    {/*VK_DEL*/  0x2e,	WCEL_DeleteCurrChar	},
     {	0,		NULL 			}
 };
 
@@ -624,6 +625,7 @@
 {
     {/*VK_LEFT*/ 0x25, 	WCEL_MoveToLeftWord 	},
     {/*VK_RIGHT*/0x27,	WCEL_MoveToRightWord	},
+    {/*VK_END*/  0x23,	WCEL_KillToEndOfLine	},
     {	0,		NULL 			}
 };

-------------- next part --------------
A non-text attachment was scrubbed...
Name: console-edit1.patch.5
Type: application/octet-stream
Size: 1201 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20020429/194dbc1a/console-edit1.patch.obj


More information about the wine-patches mailing list