diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-09-19 20:42:03 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-09-19 20:42:03 -0400 |
commit | 0375128377ef89d833e19a5e58a69f628a0e5d6c (patch) | |
tree | ce906ba95f258c9c40062bf34276f6615a4137f4 /src/nvim/os_unix.c | |
parent | dc6db20febf1ce1848e87f8950c48a78aaffd8f6 (diff) | |
parent | 3253e7ec09e8c26c31ad5d2172fd664864012f38 (diff) | |
download | rneovim-0375128377ef89d833e19a5e58a69f628a0e5d6c.tar.gz rneovim-0375128377ef89d833e19a5e58a69f628a0e5d6c.tar.bz2 rneovim-0375128377ef89d833e19a5e58a69f628a0e5d6c.zip |
Merge pull request #1150 from splinterofchaos/vim-patch-7.4.305
Vim patch 7.4.305 + Vim patch 7.4.359
Diffstat (limited to 'src/nvim/os_unix.c')
-rw-r--r-- | src/nvim/os_unix.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index a54ed000af..52f57f8262 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 + resume_get_esc_sequence(); + } 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); + } } /* |