Re: kernel32/editline: Enabling/disabling Insert Mode via the user dialog should take effect immediately
On 20.07.2015 04:02, Hugh McMaster wrote:
Currently, if Insert Mode is enabled/disabled via the user dialog, the new console mode does not take effect until after CONSOLE_Readline is called again.
On Windows, this change takes effect immediately. --- dlls/kernel32/editline.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/kernel32/editline.c b/dlls/kernel32/editline.c index 7664b55..581ea7c 100644 --- a/dlls/kernel32/editline.c +++ b/dlls/kernel32/editline.c @@ -987,6 +987,10 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, BOOL can_pos_cursor) } }
+ GetConsoleMode(hConsoleIn, &mode); + ctx.insert = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) == + (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS) ? 1 : 0;
You can remove the " ? 1 : 0" here, the value is already BOOL.
+ if (func) (func)(&ctx); else if (!(ir.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED))
On Monday, 20 July 2015 04:08:28 +0200, Sebastian Lackner wrote:
On 20.07.2015 04:02, Hugh McMaster wrote:
+ GetConsoleMode(hConsoleIn, &mode); + ctx.insert = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) == + (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS) ? 1 : 0;
You can remove the " ? 1 : 0" here, the value is already BOOL.
Thanks. I've sent an updated patch.
participants (2)
-
Hugh McMaster -
Sebastian Lackner