> Always using the position from g_cbNonTermcap seems strange. > Should we not depend on the value of g_fTermcapMode?
It was too simple. It is a failure. I think that it is okay with this patch. This is to check the g_fTermcapMode. -------- Thanks. Nobuhiro Takasaki -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
diff --git a/src/os_win32.c b/src/os_win32.c index 5114863..198ccd5 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -228,6 +228,8 @@ static int win32_getattrs(char_u *name); static int win32_setattrs(char_u *name, int attrs); static int win32_set_archive(char_u *name); +static void set_console_cursor_position(void); + #ifndef FEAT_GUI_W32 static int suppress_winsize = 1; /* don't fiddle with console */ #endif @@ -1396,7 +1398,7 @@ mch_set_cursor_shape(int thickness) SetConsoleCursorInfo(g_hConOut, &ConsoleCursorInfo); if (s_cursor_visible) - SetConsoleCursorPosition(g_hConOut, g_coord); + set_console_cursor_position(); } void @@ -6743,3 +6745,15 @@ fix_arg_enc(void) set_alist_count(); } #endif + + static void +set_console_cursor_position(void) +{ + CONSOLE_SCREEN_BUFFER_INFO i; + + if (g_fTermcapMode) + return; + + GetConsoleScreenBufferInfo(g_cbNonTermcap.handle, &i); + SetConsoleCursorPosition(g_hConOut, i.dwCursorPosition); +}