diff --git a/src/os_win32.c b/src/os_win32.c index 8a1ed72d7c0cd1..477fd844985990 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -1165,6 +1165,7 @@ decode_key_event( #endif // FEAT_GUI_MSWIN +static DWORD g_cmodein = 0; /* * For the GUI the mouse handling is in gui_w32.c. @@ -1200,9 +1201,15 @@ mch_setmouse(int on) GetConsoleMode(g_hConIn, &cmodein); if (g_fMouseActive) + { cmodein |= ENABLE_MOUSE_INPUT; + cmodein &= ~ENABLE_QUICK_EDIT_MODE; + } else + { cmodein &= ~ENABLE_MOUSE_INPUT; + cmodein |= g_cmodein & ENABLE_QUICK_EDIT_MODE; + } SetConsoleMode(g_hConIn, cmodein); } @@ -2782,7 +2789,6 @@ SaveConsoleTitleAndIcon(void) static int g_fWindInitCalled = FALSE; static int g_fTermcapMode = FALSE; static CONSOLE_CURSOR_INFO g_cci; -static DWORD g_cmodein = 0; static DWORD g_cmodeout = 0; /* @@ -3747,7 +3753,14 @@ mch_settmode(tmode_T tmode) cmodein &= ~(ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT); if (g_fMouseActive) + { cmodein |= ENABLE_MOUSE_INPUT; + cmodein &= ~ENABLE_QUICK_EDIT_MODE; + } + else + { + cmodein |= g_cmodein & ENABLE_QUICK_EDIT_MODE; + } cmodeout &= ~( # ifdef FEAT_TERMGUICOLORS // Do not turn off the ENABLE_PROCESSED_OUTPUT flag when using @@ -5621,9 +5634,15 @@ termcap_mode_start(void) GetConsoleMode(g_hConIn, &cmodein); if (g_fMouseActive) + { cmodein |= ENABLE_MOUSE_INPUT; + cmodein &= ~ENABLE_QUICK_EDIT_MODE; + } else + { cmodein &= ~ENABLE_MOUSE_INPUT; + cmodein |= g_cmodein & ENABLE_QUICK_EDIT_MODE; + } cmodein |= ENABLE_WINDOW_INPUT; SetConsoleMode(g_hConIn, cmodein); @@ -5650,6 +5669,7 @@ termcap_mode_end(void) GetConsoleMode(g_hConIn, &cmodein); cmodein &= ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); + cmodein |= g_cmodein & ENABLE_QUICK_EDIT_MODE; SetConsoleMode(g_hConIn, cmodein); # ifdef FEAT_RESTORE_ORIG_SCREEN