]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - vim/patches/vim-7.3.343.patch0
libnl3: New package.
[people/ms/ipfire-3.x.git] / vim / patches / vim-7.3.343.patch0
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.343
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.343
11 Problem: No mouse support for urxvt.
12 Solution: Implement urxvt mouse support, also for > 252 columns. (Yiding
13 Jia)
14 Files: src/feature.h, src/keymap.h, src/option.h, src/os_unix.c,
15 src/term.c, src/version.c
16
17
18 *** ../vim-7.3.342/src/feature.h 2011-05-19 13:40:47.000000000 +0200
19 --- src/feature.h 2011-10-20 21:02:15.000000000 +0200
20 ***************
21 *** 1053,1058 ****
22 --- 1053,1061 ----
23 # ifdef FEAT_BIG
24 # define FEAT_MOUSE_DEC
25 # endif
26 + # ifdef FEAT_BIG
27 + # define FEAT_MOUSE_URXVT
28 + # endif
29 # if defined(FEAT_NORMAL) && (defined(MSDOS) || defined(WIN3264))
30 # define DOS_MOUSE
31 # endif
32 ***************
33 *** 1068,1080 ****
34 #if defined(FEAT_NORMAL) && defined(HAVE_SYSMOUSE)
35 # define FEAT_SYSMOUSE
36 #endif
37 /* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */
38 #if !defined(FEAT_MOUSE_TTY) \
39 && (defined(FEAT_MOUSE_XTERM) \
40 ! || defined(FEAT_MOUSE_NET) || defined(FEAT_MOUSE_DEC) \
41 ! || defined(DOS_MOUSE) || defined(FEAT_MOUSE_GPM) \
42 ! || defined(FEAT_MOUSE_JSB) || defined(FEAT_MOUSE_PTERM) \
43 ! || defined(FEAT_SYSMOUSE))
44 # define FEAT_MOUSE_TTY /* include non-GUI mouse support */
45 #endif
46 #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI))
47 --- 1071,1093 ----
48 #if defined(FEAT_NORMAL) && defined(HAVE_SYSMOUSE)
49 # define FEAT_SYSMOUSE
50 #endif
51 +
52 + /* urxvt is a small variation of mouse_xterm, and shares its code */
53 + #if defined(FEAT_MOUSE_URXVT) && !defined(FEAT_MOUSE_XTERM)
54 + # define FEAT_MOUSE_XTERM
55 + #endif
56 +
57 /* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */
58 #if !defined(FEAT_MOUSE_TTY) \
59 && (defined(FEAT_MOUSE_XTERM) \
60 ! || defined(FEAT_MOUSE_NET) \
61 ! || defined(FEAT_MOUSE_DEC) \
62 ! || defined(DOS_MOUSE) \
63 ! || defined(FEAT_MOUSE_GPM) \
64 ! || defined(FEAT_MOUSE_JSB) \
65 ! || defined(FEAT_MOUSE_PTERM) \
66 ! || defined(FEAT_SYSMOUSE) \
67 ! || defined(FEAT_MOUSE_URXVT))
68 # define FEAT_MOUSE_TTY /* include non-GUI mouse support */
69 #endif
70 #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI))
71 *** ../vim-7.3.342/src/keymap.h 2010-08-15 21:57:32.000000000 +0200
72 --- src/keymap.h 2011-10-20 21:00:37.000000000 +0200
73 ***************
74 *** 92,104 ****
75 */
76 #define KS_TEAROFF 244
77
78 ! /* used for JSB term mouse */
79 #define KS_JSBTERM_MOUSE 243
80
81 ! /* used a termcap entry that produces a normal character */
82 #define KS_KEY 242
83
84 ! /* Used for the qnx pterm mouse */
85 #define KS_PTERM_MOUSE 241
86
87 /* Used for click in a tab pages label. */
88 --- 92,104 ----
89 */
90 #define KS_TEAROFF 244
91
92 ! /* Used for JSB term mouse. */
93 #define KS_JSBTERM_MOUSE 243
94
95 ! /* Used a termcap entry that produces a normal character. */
96 #define KS_KEY 242
97
98 ! /* Used for the qnx pterm mouse. */
99 #define KS_PTERM_MOUSE 241
100
101 /* Used for click in a tab pages label. */
102 ***************
103 *** 107,112 ****
104 --- 107,115 ----
105 /* Used for menu in a tab pages line. */
106 #define KS_TABMENU 239
107
108 + /* Used for the urxvt mouse. */
109 + #define KS_URXVT_MOUSE 238
110 +
111 /*
112 * Filler used after KS_SPECIAL and others
113 */
114 *** ../vim-7.3.342/src/option.h 2011-09-30 14:44:49.000000000 +0200
115 --- src/option.h 2011-10-20 19:38:59.000000000 +0200
116 ***************
117 *** 819,825 ****
118 EXTERN char_u *p_ttym; /* 'ttymouse' */
119 EXTERN unsigned ttym_flags;
120 # ifdef IN_OPTION_C
121 ! static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", NULL};
122 # endif
123 # define TTYM_XTERM 0x01
124 # define TTYM_XTERM2 0x02
125 --- 819,825 ----
126 EXTERN char_u *p_ttym; /* 'ttymouse' */
127 EXTERN unsigned ttym_flags;
128 # ifdef IN_OPTION_C
129 ! static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", NULL};
130 # endif
131 # define TTYM_XTERM 0x01
132 # define TTYM_XTERM2 0x02
133 ***************
134 *** 827,832 ****
135 --- 827,833 ----
136 # define TTYM_NETTERM 0x08
137 # define TTYM_JSBTERM 0x10
138 # define TTYM_PTERM 0x20
139 + # define TTYM_URXVT 0x40
140 #endif
141 EXTERN char_u *p_udir; /* 'undodir' */
142 EXTERN long p_ul; /* 'undolevels' */
143 *** ../vim-7.3.342/src/os_unix.c 2011-10-12 21:04:15.000000000 +0200
144 --- src/os_unix.c 2011-10-20 21:02:00.000000000 +0200
145 ***************
146 *** 2158,2167 ****
147 --- 2158,2170 ----
148 * Return non-zero when using an xterm mouse, according to 'ttymouse'.
149 * Return 1 for "xterm".
150 * Return 2 for "xterm2".
151 + * Return 3 for "urxvt".
152 */
153 int
154 use_xterm_mouse()
155 {
156 + if (ttym_flags == TTYM_URXVT)
157 + return 3;
158 if (ttym_flags == TTYM_XTERM2)
159 return 2;
160 if (ttym_flags == TTYM_XTERM)
161 ***************
162 *** 3318,3323 ****
163 --- 3321,3337 ----
164 return;
165
166 xterm_mouse_vers = use_xterm_mouse();
167 +
168 + # ifdef FEAT_MOUSE_URXVT
169 + if (ttym_flags == TTYM_URXVT) {
170 + out_str_nf((char_u *)
171 + (on
172 + ? IF_EB("\033[?1015h", ESC_STR "[?1015h")
173 + : IF_EB("\033[?1015l", ESC_STR "[?1015l")));
174 + ison = on;
175 + }
176 + # endif
177 +
178 if (xterm_mouse_vers > 0)
179 {
180 if (on) /* enable mouse events, use mouse tracking if available */
181 ***************
182 *** 3434,3439 ****
183 --- 3448,3456 ----
184 {
185 # ifdef FEAT_MOUSE_XTERM
186 if (use_xterm_mouse()
187 + # ifdef FEAT_MOUSE_URXVT
188 + && use_xterm_mouse() != 3
189 + # endif
190 # ifdef FEAT_GUI
191 && !gui.in_use
192 # endif
193 ***************
194 *** 3523,3528 ****
195 --- 3540,3566 ----
196 else
197 del_mouse_termcode(KS_PTERM_MOUSE);
198 # endif
199 + # ifdef FEAT_MOUSE_URXVT
200 + /* same as the dec mouse */
201 + if (use_xterm_mouse() == 3
202 + # ifdef FEAT_GUI
203 + && !gui.in_use
204 + # endif
205 + )
206 + {
207 + set_mouse_termcode(KS_URXVT_MOUSE, (char_u *)(term_is_8bit(T_NAME)
208 + ? IF_EB("\233", CSI_STR)
209 + : IF_EB("\033[", ESC_STR "[")));
210 +
211 + if (*p_mouse != NUL)
212 + {
213 + mch_setmouse(FALSE);
214 + setmouse();
215 + }
216 + }
217 + else
218 + del_mouse_termcode(KS_URXVT_MOUSE);
219 + # endif
220 }
221 #endif
222
223 *** ../vim-7.3.342/src/version.c 2011-10-20 18:24:16.000000000 +0200
224 --- src/version.c 2011-10-20 19:40:48.000000000 +0200
225 ***************
226 *** 380,383 ****
227 --- 380,388 ----
228 "-mouse_xterm",
229 # endif
230 + # ifdef FEAT_MOUSE_URXVT
231 + "+mouse_urxvt",
232 + # else
233 + "-mouse_urxvt",
234 + # endif
235 #endif
236 #ifdef __QNX__
237 ***************
238 *** 711,712 ****
239 --- 716,719 ----
240 { /* Add new patch number below this line */
241 + /**/
242 + 343,
243 /**/
244
245 --
246 Warning label on a superhero Halloween costume:
247 "Caution: Cape does not enable user to fly."
248
249 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
250 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
251 \\\ an exciting new programming language -- http://www.Zimbu.org ///
252 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///