comparison src/term.c @ 11563:2547bbe6716e v8.0.0664

patch 8.0.0664: mouse does not work in tmux commit https://github.com/vim/vim/commit/6d006f9e950364898240b7a6358516bbf73fe458 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 23 22:35:34 2017 +0200 patch 8.0.0664: mouse does not work in tmux Problem: Mouse does not work in tmux. (lilydjwg) Solution: Add flag for SGR release being present.
author Christian Brabandt <cb@256bit.org>
date Fri, 23 Jun 2017 22:45:04 +0200
parents 7e5e76d8d451
children 91519a14ec1f
comparison
equal deleted inserted replaced
11562:c48952607d81 11563:2547bbe6716e
1799 /* 1799 /*
1800 * For Unix, set the 'ttymouse' option to the type of mouse to be used. 1800 * For Unix, set the 'ttymouse' option to the type of mouse to be used.
1801 * The termcode for the mouse is added as a side effect in option.c. 1801 * The termcode for the mouse is added as a side effect in option.c.
1802 */ 1802 */
1803 { 1803 {
1804 char_u *p; 1804 char_u *p = (char_u *)"";
1805 1805
1806 p = (char_u *)"";
1807 # ifdef FEAT_MOUSE_XTERM 1806 # ifdef FEAT_MOUSE_XTERM
1808 if (use_xterm_like_mouse(term)) 1807 if (use_xterm_like_mouse(term))
1809 { 1808 {
1810 if (use_xterm_mouse()) 1809 if (use_xterm_mouse())
1811 p = NULL; /* keep existing value, might be "xterm2" */ 1810 p = NULL; /* keep existing value, might be "xterm2" */
1942 # define HMT_DEC 4 1941 # define HMT_DEC 4
1943 # define HMT_JSBTERM 8 1942 # define HMT_JSBTERM 8
1944 # define HMT_PTERM 16 1943 # define HMT_PTERM 16
1945 # define HMT_URXVT 32 1944 # define HMT_URXVT 32
1946 # define HMT_SGR 64 1945 # define HMT_SGR 64
1946 # define HMT_SGR_REL 128
1947 static int has_mouse_termcode = 0; 1947 static int has_mouse_termcode = 0;
1948 # endif 1948 # endif
1949 1949
1950 # if (!defined(UNIX) || defined(FEAT_MOUSE_TTY)) || defined(PROTO) 1950 # if (!defined(UNIX) || defined(FEAT_MOUSE_TTY)) || defined(PROTO)
1951 void 1951 void
1985 else 1985 else
1986 # endif 1986 # endif
1987 # ifdef FEAT_MOUSE_SGR 1987 # ifdef FEAT_MOUSE_SGR
1988 if (n == KS_SGR_MOUSE) 1988 if (n == KS_SGR_MOUSE)
1989 has_mouse_termcode |= HMT_SGR; 1989 has_mouse_termcode |= HMT_SGR;
1990 else if (n == KS_SGR_MOUSE_RELEASE)
1991 has_mouse_termcode |= HMT_SGR_REL;
1990 else 1992 else
1991 # endif 1993 # endif
1992 has_mouse_termcode |= HMT_NORMAL; 1994 has_mouse_termcode |= HMT_NORMAL;
1993 # endif 1995 # endif
1994 } 1996 }
2032 else 2034 else
2033 # endif 2035 # endif
2034 # ifdef FEAT_MOUSE_SGR 2036 # ifdef FEAT_MOUSE_SGR
2035 if (n == KS_SGR_MOUSE) 2037 if (n == KS_SGR_MOUSE)
2036 has_mouse_termcode &= ~HMT_SGR; 2038 has_mouse_termcode &= ~HMT_SGR;
2039 else if (n == KS_SGR_MOUSE_RELEASE)
2040 has_mouse_termcode &= ~HMT_SGR_REL;
2037 else 2041 else
2038 # endif 2042 # endif
2039 has_mouse_termcode &= ~HMT_NORMAL; 2043 has_mouse_termcode &= ~HMT_NORMAL;
2040 # endif 2044 # endif
2041 } 2045 }