Hugh McMaster : kernel32: Reset insert key toggle when Insert Mode changes.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 17 09:01:12 CDT 2015


Module: wine
Branch: master
Commit: ac3a684d3b5b939772fb0a22d99e9a9c2d8201c4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ac3a684d3b5b939772fb0a22d99e9a9c2d8201c4

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Thu Aug 13 15:22:17 2015 +1000

kernel32: Reset insert key toggle when Insert Mode changes.

---

 dlls/kernel32/editline.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/kernel32/editline.c b/dlls/kernel32/editline.c
index c0234d7..b330869 100644
--- a/dlls/kernel32/editline.c
+++ b/dlls/kernel32/editline.c
@@ -913,7 +913,7 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, BOOL can_pos_cursor)
     const KeyEntry*	ke;
     unsigned		ofs;
     void		(*func)(struct WCEL_Context* ctx);
-    DWORD               mode, ks;
+    DWORD               mode, input_mode, ks;
     int                 use_emacs;
 
     memset(&ctx, 0, sizeof(ctx));
@@ -928,6 +928,7 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, BOOL can_pos_cursor)
 	!GetConsoleScreenBufferInfo(ctx.hConOut, &ctx.csbi))
 	return NULL;
     if (!GetConsoleMode(hConsoleIn, &mode)) mode = 0;
+    input_mode = mode;
     ctx.shall_echo = (mode & ENABLE_ECHO_INPUT) ? 1 : 0;
     ctx.insert = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) == (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS) ? 1 : 0;
     if (!GetConsoleMode(ctx.hConOut, &mode)) mode = 0;
@@ -982,6 +983,11 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, BOOL can_pos_cursor)
 	}
 
         GetConsoleMode(hConsoleIn, &mode);
+        if (input_mode != mode)
+        {
+            input_mode = mode;
+            ctx.insertkey = 0;
+        }
         ctx.insert = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) ==
                      (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS);
         if (ctx.insertkey)




More information about the wine-cvs mailing list