summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.3.343
blob: db62264d0b516389cb502e48256ba6f807ea6e6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
To: vim_dev@googlegroups.com
Subject: Patch 7.3.343
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.343
Problem:    No mouse support for urxvt.
Solution:   Implement urxvt mouse support, also for > 252 columns.  (Yiding
	    Jia)
Files:	    src/feature.h, src/keymap.h, src/option.h, src/os_unix.c,
	    src/term.c, src/version.c


*** ../vim-7.3.342/src/feature.h	2011-05-19 13:40:47.000000000 +0200
--- src/feature.h	2011-10-20 21:02:15.000000000 +0200
***************
*** 1053,1058 ****
--- 1053,1061 ----
  # ifdef FEAT_BIG
  #  define FEAT_MOUSE_DEC
  # endif
+ # ifdef FEAT_BIG
+ #  define FEAT_MOUSE_URXVT
+ # endif
  # if defined(FEAT_NORMAL) && (defined(MSDOS) || defined(WIN3264))
  #  define DOS_MOUSE
  # endif
***************
*** 1068,1080 ****
  #if defined(FEAT_NORMAL) && defined(HAVE_SYSMOUSE)
  # define FEAT_SYSMOUSE
  #endif
  /* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */
  #if !defined(FEAT_MOUSE_TTY) \
  	&& (defined(FEAT_MOUSE_XTERM) \
! 	    || defined(FEAT_MOUSE_NET) || defined(FEAT_MOUSE_DEC) \
! 	    || defined(DOS_MOUSE) || defined(FEAT_MOUSE_GPM) \
! 	    || defined(FEAT_MOUSE_JSB) || defined(FEAT_MOUSE_PTERM) \
! 	    || defined(FEAT_SYSMOUSE))
  # define FEAT_MOUSE_TTY		/* include non-GUI mouse support */
  #endif
  #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI))
--- 1071,1093 ----
  #if defined(FEAT_NORMAL) && defined(HAVE_SYSMOUSE)
  # define FEAT_SYSMOUSE
  #endif
+ 
+ /* urxvt is a small variation of mouse_xterm, and shares its code */
+ #if defined(FEAT_MOUSE_URXVT) && !defined(FEAT_MOUSE_XTERM)
+ # define FEAT_MOUSE_XTERM
+ #endif
+ 
  /* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */
  #if !defined(FEAT_MOUSE_TTY) \
  	&& (defined(FEAT_MOUSE_XTERM) \
! 	    || defined(FEAT_MOUSE_NET) \
! 	    || defined(FEAT_MOUSE_DEC) \
! 	    || defined(DOS_MOUSE) \
! 	    || defined(FEAT_MOUSE_GPM) \
! 	    || defined(FEAT_MOUSE_JSB) \
! 	    || defined(FEAT_MOUSE_PTERM) \
! 	    || defined(FEAT_SYSMOUSE) \
! 	    || defined(FEAT_MOUSE_URXVT))
  # define FEAT_MOUSE_TTY		/* include non-GUI mouse support */
  #endif
  #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI))
*** ../vim-7.3.342/src/keymap.h	2010-08-15 21:57:32.000000000 +0200
--- src/keymap.h	2011-10-20 21:00:37.000000000 +0200
***************
*** 92,104 ****
   */
  #define KS_TEAROFF		244
  
! /* used for JSB term mouse */
  #define KS_JSBTERM_MOUSE	243
  
! /* used a termcap entry that produces a normal character */
  #define KS_KEY			242
  
! /* Used for the qnx pterm mouse */
  #define KS_PTERM_MOUSE		241
  
  /* Used for click in a tab pages label. */
--- 92,104 ----
   */
  #define KS_TEAROFF		244
  
! /* Used for JSB term mouse. */
  #define KS_JSBTERM_MOUSE	243
  
! /* Used a termcap entry that produces a normal character. */
  #define KS_KEY			242
  
! /* Used for the qnx pterm mouse. */
  #define KS_PTERM_MOUSE		241
  
  /* Used for click in a tab pages label. */
***************
*** 107,112 ****
--- 107,115 ----
  /* Used for menu in a tab pages line. */
  #define KS_TABMENU		239
  
+ /* Used for the urxvt mouse. */
+ #define KS_URXVT_MOUSE		238
+ 
  /*
   * Filler used after KS_SPECIAL and others
   */
*** ../vim-7.3.342/src/option.h	2011-09-30 14:44:49.000000000 +0200
--- src/option.h	2011-10-20 19:38:59.000000000 +0200
***************
*** 819,825 ****
  EXTERN char_u	*p_ttym;	/* 'ttymouse' */
  EXTERN unsigned ttym_flags;
  # ifdef IN_OPTION_C
! static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", NULL};
  # endif
  # define TTYM_XTERM		0x01
  # define TTYM_XTERM2		0x02
--- 819,825 ----
  EXTERN char_u	*p_ttym;	/* 'ttymouse' */
  EXTERN unsigned ttym_flags;
  # ifdef IN_OPTION_C
! static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", NULL};
  # endif
  # define TTYM_XTERM		0x01
  # define TTYM_XTERM2		0x02
***************
*** 827,832 ****
--- 827,833 ----
  # define TTYM_NETTERM		0x08
  # define TTYM_JSBTERM		0x10
  # define TTYM_PTERM		0x20
+ # define TTYM_URXVT		0x40
  #endif
  EXTERN char_u	*p_udir;	/* 'undodir' */
  EXTERN long	p_ul;		/* 'undolevels' */
*** ../vim-7.3.342/src/os_unix.c	2011-10-12 21:04:15.000000000 +0200
--- src/os_unix.c	2011-10-20 21:02:00.000000000 +0200
***************
*** 2158,2167 ****
--- 2158,2170 ----
   * Return non-zero when using an xterm mouse, according to 'ttymouse'.
   * Return 1 for "xterm".
   * Return 2 for "xterm2".
+  * Return 3 for "urxvt".
   */
      int
  use_xterm_mouse()
  {
+     if (ttym_flags == TTYM_URXVT)
+ 	return 3;
      if (ttym_flags == TTYM_XTERM2)
  	return 2;
      if (ttym_flags == TTYM_XTERM)
***************
*** 3318,3323 ****
--- 3321,3337 ----
  	return;
  
      xterm_mouse_vers = use_xterm_mouse();
+ 
+ # ifdef FEAT_MOUSE_URXVT
+     if (ttym_flags == TTYM_URXVT) {
+ 	out_str_nf((char_u *)
+ 		   (on
+ 		   ? IF_EB("\033[?1015h", ESC_STR "[?1015h")
+ 		   : IF_EB("\033[?1015l", ESC_STR "[?1015l")));
+ 	ison = on;
+     }
+ # endif
+ 
      if (xterm_mouse_vers > 0)
      {
  	if (on)	/* enable mouse events, use mouse tracking if available */
***************
*** 3434,3439 ****
--- 3448,3456 ----
  {
  # ifdef FEAT_MOUSE_XTERM
      if (use_xterm_mouse()
+ # ifdef FEAT_MOUSE_URXVT
+ 	    && use_xterm_mouse() != 3
+ # endif
  #  ifdef FEAT_GUI
  	    && !gui.in_use
  #  endif
***************
*** 3523,3528 ****
--- 3540,3566 ----
      else
  	del_mouse_termcode(KS_PTERM_MOUSE);
  # endif
+ # ifdef FEAT_MOUSE_URXVT
+     /* same as the dec mouse */
+     if (use_xterm_mouse() == 3
+ #  ifdef FEAT_GUI
+ 	    && !gui.in_use
+ #  endif
+ 	    )
+     {
+ 	set_mouse_termcode(KS_URXVT_MOUSE, (char_u *)(term_is_8bit(T_NAME)
+ 		    ? IF_EB("\233", CSI_STR)
+ 		    : IF_EB("\033[", ESC_STR "[")));
+ 
+ 	if (*p_mouse != NUL)
+ 	{
+ 	    mch_setmouse(FALSE);
+ 	    setmouse();
+ 	}
+     }
+     else
+ 	del_mouse_termcode(KS_URXVT_MOUSE);
+ # endif
  }
  #endif
  
*** ../vim-7.3.342/src/version.c	2011-10-20 18:24:16.000000000 +0200
--- src/version.c	2011-10-20 19:40:48.000000000 +0200
***************
*** 380,383 ****
--- 380,388 ----
  	"-mouse_xterm",
  # endif
+ # ifdef FEAT_MOUSE_URXVT
+ 	"+mouse_urxvt",
+ # else
+ 	"-mouse_urxvt",
+ # endif
  #endif
  #ifdef __QNX__
***************
*** 711,712 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     343,
  /**/

-- 
Warning label on a superhero Halloween costume:
"Caution: Cape does not enable user to fly."

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///