diff options
author | erw7 <erw7.github@gmail.com> | 2021-10-06 21:13:34 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-06 05:13:34 -0700 |
commit | a161559a006bcbc31a2eccbd96df3138e8bc3bc5 (patch) | |
tree | e313fcb686df3019e604762c32b31203320b2517 | |
parent | acd5e831b6294e54b12c09983bee3da89c0f183a (diff) | |
download | rneovim-a161559a006bcbc31a2eccbd96df3138e8bc3bc5.tar.gz rneovim-a161559a006bcbc31a2eccbd96df3138e8bc3bc5.tar.bz2 rneovim-a161559a006bcbc31a2eccbd96df3138e8bc3bc5.zip |
fix(tui): remove dead code #15929
Before #15889, we used our fork of libuv which supports Windows 7/8.
After #15889, we use upstream libuv, which does not support Windows 7 and lacks
mouse/altbuf support for Windows 8 console.
-rw-r--r-- | src/nvim/os/os_win_console.c | 26 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 28 |
2 files changed, 0 insertions, 54 deletions
diff --git a/src/nvim/os/os_win_console.c b/src/nvim/os/os_win_console.c index 2c9cb699fc..18e2e02b81 100644 --- a/src/nvim/os/os_win_console.c +++ b/src/nvim/os/os_win_console.c @@ -46,29 +46,3 @@ void os_replace_stdout_and_stderr_to_conout(void) const int conerr_fd = _open_osfhandle((intptr_t)conout_handle, 0); assert(conerr_fd == STDERR_FILENO); } - -void os_set_vtp(bool enable) -{ - static TriState is_legacy = kNone; - if (is_legacy == kNone) { - uv_tty_vtermstate_t state; - uv_tty_get_vterm_state(&state); - is_legacy = (state == UV_TTY_UNSUPPORTED) ? kTrue : kFalse; - } - if (!is_legacy && !os_has_vti()) { - uv_tty_set_vterm_state(enable ? UV_TTY_SUPPORTED : UV_TTY_UNSUPPORTED); - } -} - -static bool os_has_vti(void) -{ - static TriState has_vti = kNone; - if (has_vti == kNone) { - HANDLE handle = (HANDLE)_get_osfhandle(input_global_fd()); - DWORD dwMode; - if (handle != INVALID_HANDLE_VALUE && GetConsoleMode(handle, &dwMode)) { - has_vti = !!(dwMode & ENABLE_VIRTUAL_TERMINAL_INPUT) ? kTrue : kFalse; - } - } - return has_vti == kTrue; -} diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 803ff23cea..612eaf6667 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1019,22 +1019,8 @@ static void tui_mouse_on(UI *ui) { TUIData *data = ui->data; if (!data->mouse_enabled) { -#ifdef WIN32 - // Windows versions with vtp(ENABLE_VIRTUAL_TERMINAL_PROCESSING) and - // no vti(ENABLE_VIRTUAL_TERMINAL_INPUT) will need to use mouse tracking of - // libuv. For this reason, vtp (vterm) state of libuv is temporarily - // disabled because the control sequence needs to be processed by libuv - // instead of Windows vtp. - // ref. https://docs.microsoft.com/en-us/windows/console/setconsolemode - flush_buf(ui); - os_set_vtp(false); -#endif unibi_out_ext(ui, data->unibi_ext.enable_mouse); data->mouse_enabled = true; -#ifdef WIN32 - flush_buf(ui); - os_set_vtp(true); -#endif } } @@ -1042,22 +1028,8 @@ static void tui_mouse_off(UI *ui) { TUIData *data = ui->data; if (data->mouse_enabled) { -#ifdef WIN32 - // Windows versions with vtp(ENABLE_VIRTUAL_TERMINAL_PROCESSING) and - // no vti(ENABLE_VIRTUAL_TERMINAL_INPUT) will need to use mouse tracking of - // libuv. For this reason, vtp (vterm) state of libuv is temporarily - // disabled because the control sequence needs to be processed by libuv - // instead of Windows vtp. - // ref. https://docs.microsoft.com/en-us/windows/console/setconsolemode - flush_buf(ui); - os_set_vtp(false); -#endif unibi_out_ext(ui, data->unibi_ext.disable_mouse); data->mouse_enabled = false; -#ifdef WIN32 - flush_buf(ui); - os_set_vtp(true); -#endif } } |