From 83cd2979a10bdab903e4f3f0f5bb0c85573522b6 Mon Sep 17 00:00:00 2001 From: Scott Prager Date: Tue, 9 Sep 2014 13:13:23 -0400 Subject: vim-patch:7.4.305 Problem: Making 'ttymouse' empty after the xterm version was requested causes problems. (Elijah Griffin) Solution: Do not check for DEC mouse sequences when the xterm version was requested. Also don't request the xterm version when DEC mouse was enabled. https://code.google.com/p/vim/source/detail?r=v7-4-305 --- src/nvim/os_unix.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index a54ed000af..23dc79b896 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -761,11 +761,11 @@ void mch_setmouse(int on) } -/* - * Set the mouse termcode, depending on the 'term' and 'ttymouse' options. - */ +/// Sets the mouse termcode, depending on the 'term' and 'ttymouse' options. void check_mouse_termcode(void) { + xterm_conflict_mouse = false; + if (use_xterm_mouse() && use_xterm_mouse() != 3 ) { @@ -791,29 +791,31 @@ void check_mouse_termcode(void) else del_mouse_termcode(KS_NETTERM_MOUSE); - /* conflicts with xterm mouse: "\033[" and "\033[M" */ - if (!use_xterm_mouse() - ) + // Conflicts with xterm mouse: "\033[" and "\033[M". + // Also conflicts with the xterm termresponse, skip this if it was requested + // already. + if (!use_xterm_mouse()) { set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME) ? "\233" : "\033[")); - else + xterm_conflict_mouse = true; + } + else { del_mouse_termcode(KS_DEC_MOUSE); + } /* same as the dec mouse */ - if (use_xterm_mouse() == 3 - ) { - set_mouse_termcode(KS_URXVT_MOUSE, (char_u *)(term_is_8bit(T_NAME) - ? "\233" - : "\033[")); - + if (use_xterm_mouse() == 3 && !did_request_esc_sequence()) { + set_mouse_termcode(KS_URXVT_MOUSE, + (char_u *)(term_is_8bit(T_NAME) ? "\233" : "\033[")); if (*p_mouse != NUL) { - mch_setmouse(FALSE); + mch_setmouse(false); setmouse(); } - } else + xterm_conflict_mouse = true; + } else { del_mouse_termcode(KS_URXVT_MOUSE); - /* There is no conflict with xterm mouse */ - if (use_xterm_mouse() == 4 - ) { + } + // There is no conflict with xterm mouse. + if (use_xterm_mouse() == 4) { set_mouse_termcode(KS_SGR_MOUSE, (char_u *)(term_is_8bit(T_NAME) ? "\233<" : "\033[<")); @@ -822,8 +824,9 @@ void check_mouse_termcode(void) mch_setmouse(FALSE); setmouse(); } - } else + } else { del_mouse_termcode(KS_SGR_MOUSE); + } } /* -- cgit From 3253e7ec09e8c26c31ad5d2172fd664864012f38 Mon Sep 17 00:00:00 2001 From: Scott Prager Date: Tue, 9 Sep 2014 14:44:10 -0400 Subject: vim-patch:7.4.359 Problem: When 'ttymouse' is set to 'uxterm' the xterm version is not requested. (Tomas Janousek) Solution: Do not mark uxterm as a conflict mouse and add resume_get_esc_sequence(). https://code.google.com/p/vim/source/detail?r=v7-4-359 --- src/nvim/os_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 23dc79b896..52f57f8262 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -810,7 +810,7 @@ void check_mouse_termcode(void) mch_setmouse(false); setmouse(); } - xterm_conflict_mouse = true; + resume_get_esc_sequence(); } else { del_mouse_termcode(KS_URXVT_MOUSE); } -- cgit