]>
Commit | Line | Data |
---|---|---|
c0949972 ER |
1 | To: vim-dev@vim.org |
2 | Subject: patch 7.1.104 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.1.104 (after 7.1.095) | |
11 | Problem: When 'lazyredraw' is set a focus event causes redraw to be | |
12 | postponed until a key is pressed. | |
13 | Solution: Instead of not returning from vgetc() when a focus event is | |
14 | encountered return K_IGNORE. Add plain_vgetc() for when the | |
15 | caller doesn't want to get K_IGNORE. | |
16 | Files: src/digraph.c, src/edit.c, src/ex_cmds.c, src/ex_getln.c, | |
17 | src/getchar.c, src/normal.c, src/proto/getchar.pro, src/window.c | |
18 | ||
19 | ||
20 | *** ../vim-7.1.103/src/digraph.c Sat Jul 7 13:57:39 2007 | |
21 | --- src/digraph.c Thu Sep 13 16:11:54 2007 | |
22 | *************** | |
23 | *** 2028,2034 **** | |
24 | ||
25 | ++no_mapping; | |
26 | ++allow_keys; | |
27 | ! c = safe_vgetc(); | |
28 | --no_mapping; | |
29 | --allow_keys; | |
30 | if (c != ESC) /* ESC cancels CTRL-K */ | |
31 | --- 2028,2034 ---- | |
32 | ||
33 | ++no_mapping; | |
34 | ++allow_keys; | |
35 | ! c = plain_vgetc(); | |
36 | --no_mapping; | |
37 | --allow_keys; | |
38 | if (c != ESC) /* ESC cancels CTRL-K */ | |
39 | *************** | |
40 | *** 2050,2056 **** | |
41 | #endif | |
42 | ++no_mapping; | |
43 | ++allow_keys; | |
44 | ! cc = safe_vgetc(); | |
45 | --no_mapping; | |
46 | --allow_keys; | |
47 | if (cc != ESC) /* ESC cancels CTRL-K */ | |
48 | --- 2050,2056 ---- | |
49 | #endif | |
50 | ++no_mapping; | |
51 | ++allow_keys; | |
52 | ! cc = plain_vgetc(); | |
53 | --no_mapping; | |
54 | --allow_keys; | |
55 | if (cc != ESC) /* ESC cancels CTRL-K */ | |
56 | *************** | |
57 | *** 2350,2356 **** | |
58 | if (*curbuf->b_p_keymap == NUL) | |
59 | { | |
60 | /* Stop any active keymap and clear the table. Also remove | |
61 | ! * b:keymap_unload, as no keymap is active now. */ | |
62 | keymap_unload(); | |
63 | do_cmdline_cmd((char_u *)"unlet! b:keymap_name"); | |
64 | } | |
65 | --- 2350,2356 ---- | |
66 | if (*curbuf->b_p_keymap == NUL) | |
67 | { | |
68 | /* Stop any active keymap and clear the table. Also remove | |
69 | ! * b:keymap_name, as no keymap is active now. */ | |
70 | keymap_unload(); | |
71 | do_cmdline_cmd((char_u *)"unlet! b:keymap_name"); | |
72 | } | |
73 | *** ../vim-7.1.103/src/edit.c Sun Aug 12 16:38:03 2007 | |
74 | --- src/edit.c Thu Sep 13 16:17:54 2007 | |
75 | *************** | |
76 | *** 788,794 **** | |
77 | ins_redraw(FALSE); | |
78 | ++no_mapping; | |
79 | ++allow_keys; | |
80 | ! c = safe_vgetc(); | |
81 | --no_mapping; | |
82 | --allow_keys; | |
83 | if (c != Ctrl_N && c != Ctrl_G && c != Ctrl_O) | |
84 | --- 788,794 ---- | |
85 | ins_redraw(FALSE); | |
86 | ++no_mapping; | |
87 | ++allow_keys; | |
88 | ! c = plain_vgetc(); | |
89 | --no_mapping; | |
90 | --allow_keys; | |
91 | if (c != Ctrl_N && c != Ctrl_G && c != Ctrl_O) | |
92 | *************** | |
93 | *** 981,987 **** | |
94 | #ifdef FEAT_NETBEANS_INTG | |
95 | case K_F21: /* NetBeans command */ | |
96 | ++no_mapping; /* don't map the next key hits */ | |
97 | ! i = safe_vgetc(); | |
98 | --no_mapping; | |
99 | netbeans_keycommand(i); | |
100 | break; | |
101 | --- 981,987 ---- | |
102 | #ifdef FEAT_NETBEANS_INTG | |
103 | case K_F21: /* NetBeans command */ | |
104 | ++no_mapping; /* don't map the next key hits */ | |
105 | ! i = plain_vgetc(); | |
106 | --no_mapping; | |
107 | netbeans_keycommand(i); | |
108 | break; | |
109 | *************** | |
110 | *** 5224,5233 **** | |
111 | i = 0; | |
112 | for (;;) | |
113 | { | |
114 | ! do | |
115 | ! nc = safe_vgetc(); | |
116 | ! while (nc == K_IGNORE || nc == K_VER_SCROLLBAR | |
117 | ! || nc == K_HOR_SCROLLBAR); | |
118 | #ifdef FEAT_CMDL_INFO | |
119 | if (!(State & CMDLINE) | |
120 | # ifdef FEAT_MBYTE | |
121 | --- 5224,5230 ---- | |
122 | i = 0; | |
123 | for (;;) | |
124 | { | |
125 | ! nc = plain_vgetc(); | |
126 | #ifdef FEAT_CMDL_INFO | |
127 | if (!(State & CMDLINE) | |
128 | # ifdef FEAT_MBYTE | |
129 | *************** | |
130 | *** 7575,7581 **** | |
131 | * deleted when ESC is hit. | |
132 | */ | |
133 | ++no_mapping; | |
134 | ! regname = safe_vgetc(); | |
135 | #ifdef FEAT_LANGMAP | |
136 | LANGMAP_ADJUST(regname, TRUE); | |
137 | #endif | |
138 | --- 7572,7578 ---- | |
139 | * deleted when ESC is hit. | |
140 | */ | |
141 | ++no_mapping; | |
142 | ! regname = plain_vgetc(); | |
143 | #ifdef FEAT_LANGMAP | |
144 | LANGMAP_ADJUST(regname, TRUE); | |
145 | #endif | |
146 | *************** | |
147 | *** 7586,7592 **** | |
148 | #ifdef FEAT_CMDL_INFO | |
149 | add_to_showcmd_c(literally); | |
150 | #endif | |
151 | ! regname = safe_vgetc(); | |
152 | #ifdef FEAT_LANGMAP | |
153 | LANGMAP_ADJUST(regname, TRUE); | |
154 | #endif | |
155 | --- 7583,7589 ---- | |
156 | #ifdef FEAT_CMDL_INFO | |
157 | add_to_showcmd_c(literally); | |
158 | #endif | |
159 | ! regname = plain_vgetc(); | |
160 | #ifdef FEAT_LANGMAP | |
161 | LANGMAP_ADJUST(regname, TRUE); | |
162 | #endif | |
163 | *************** | |
164 | *** 7677,7683 **** | |
165 | * deleted when ESC is hit. | |
166 | */ | |
167 | ++no_mapping; | |
168 | ! c = safe_vgetc(); | |
169 | --no_mapping; | |
170 | switch (c) | |
171 | { | |
172 | --- 7674,7680 ---- | |
173 | * deleted when ESC is hit. | |
174 | */ | |
175 | ++no_mapping; | |
176 | ! c = plain_vgetc(); | |
177 | --no_mapping; | |
178 | switch (c) | |
179 | { | |
180 | *************** | |
181 | *** 9356,9362 **** | |
182 | * mode message to be deleted when ESC is hit */ | |
183 | ++no_mapping; | |
184 | ++allow_keys; | |
185 | ! c = safe_vgetc(); | |
186 | --no_mapping; | |
187 | --allow_keys; | |
188 | if (IS_SPECIAL(c) || mod_mask) /* special key */ | |
189 | --- 9353,9359 ---- | |
190 | * mode message to be deleted when ESC is hit */ | |
191 | ++no_mapping; | |
192 | ++allow_keys; | |
193 | ! c = plain_vgetc(); | |
194 | --no_mapping; | |
195 | --allow_keys; | |
196 | if (IS_SPECIAL(c) || mod_mask) /* special key */ | |
197 | *************** | |
198 | *** 9388,9394 **** | |
199 | } | |
200 | ++no_mapping; | |
201 | ++allow_keys; | |
202 | ! cc = safe_vgetc(); | |
203 | --no_mapping; | |
204 | --allow_keys; | |
205 | if (cc != ESC) | |
206 | --- 9385,9391 ---- | |
207 | } | |
208 | ++no_mapping; | |
209 | ++allow_keys; | |
210 | ! cc = plain_vgetc(); | |
211 | --no_mapping; | |
212 | --allow_keys; | |
213 | if (cc != ESC) | |
214 | *** ../vim-7.1.103/src/ex_cmds.c Tue Aug 21 15:28:32 2007 | |
215 | --- src/ex_cmds.c Thu Sep 13 16:19:40 2007 | |
216 | *************** | |
217 | *** 4498,4504 **** | |
218 | * | |
219 | * The new text is built up in new_start[]. It has some extra | |
220 | * room to avoid using alloc()/free() too often. new_start_len is | |
221 | ! * the lenght of the allocated memory at new_start. | |
222 | * | |
223 | * Make a copy of the old line, so it won't be taken away when | |
224 | * updating the screen or handling a multi-line match. The "old_" | |
225 | --- 4499,4505 ---- | |
226 | * | |
227 | * The new text is built up in new_start[]. It has some extra | |
228 | * room to avoid using alloc()/free() too often. new_start_len is | |
229 | ! * the length of the allocated memory at new_start. | |
230 | * | |
231 | * Make a copy of the old line, so it won't be taken away when | |
232 | * updating the screen or handling a multi-line match. The "old_" | |
233 | *************** | |
234 | *** 4669,4675 **** | |
235 | #endif | |
236 | ++no_mapping; /* don't map this key */ | |
237 | ++allow_keys; /* allow special keys */ | |
238 | ! i = safe_vgetc(); | |
239 | --allow_keys; | |
240 | --no_mapping; | |
241 | ||
242 | --- 4670,4676 ---- | |
243 | #endif | |
244 | ++no_mapping; /* don't map this key */ | |
245 | ++allow_keys; /* allow special keys */ | |
246 | ! i = plain_vgetc(); | |
247 | --allow_keys; | |
248 | --no_mapping; | |
249 | ||
250 | *** ../vim-7.1.103/src/ex_getln.c Mon Aug 6 22:27:12 2007 | |
251 | --- src/ex_getln.c Thu Sep 13 16:20:49 2007 | |
252 | *************** | |
253 | *** 641,647 **** | |
254 | { | |
255 | ++no_mapping; | |
256 | ++allow_keys; | |
257 | ! c = safe_vgetc(); | |
258 | --no_mapping; | |
259 | --allow_keys; | |
260 | /* CTRL-\ e doesn't work when obtaining an expression. */ | |
261 | --- 641,647 ---- | |
262 | { | |
263 | ++no_mapping; | |
264 | ++allow_keys; | |
265 | ! c = plain_vgetc(); | |
266 | --no_mapping; | |
267 | --allow_keys; | |
268 | /* CTRL-\ e doesn't work when obtaining an expression. */ | |
269 | *************** | |
270 | *** 1091,1101 **** | |
271 | #endif | |
272 | putcmdline('"', TRUE); | |
273 | ++no_mapping; | |
274 | ! i = c = safe_vgetc(); /* CTRL-R <char> */ | |
275 | if (i == Ctrl_O) | |
276 | i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */ | |
277 | if (i == Ctrl_R) | |
278 | ! c = safe_vgetc(); /* CTRL-R CTRL-R <char> */ | |
279 | --no_mapping; | |
280 | #ifdef FEAT_EVAL | |
281 | /* | |
282 | --- 1091,1101 ---- | |
283 | #endif | |
284 | putcmdline('"', TRUE); | |
285 | ++no_mapping; | |
286 | ! i = c = plain_vgetc(); /* CTRL-R <char> */ | |
287 | if (i == Ctrl_O) | |
288 | i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */ | |
289 | if (i == Ctrl_R) | |
290 | ! c = plain_vgetc(); /* CTRL-R CTRL-R <char> */ | |
291 | --no_mapping; | |
292 | #ifdef FEAT_EVAL | |
293 | /* | |
294 | *** ../vim-7.1.103/src/getchar.c Wed Sep 5 21:45:54 2007 | |
295 | --- src/getchar.c Thu Sep 13 16:16:53 2007 | |
296 | *************** | |
297 | *** 1597,1608 **** | |
298 | } | |
299 | #endif | |
300 | #ifdef FEAT_GUI | |
301 | ! /* The caller doesn't need to know that the focus event is delayed | |
302 | ! * until getting a character. */ | |
303 | if (c == K_FOCUSGAINED || c == K_FOCUSLOST) | |
304 | { | |
305 | ui_focus_change(c == K_FOCUSGAINED); | |
306 | ! continue; | |
307 | } | |
308 | ||
309 | /* Translate K_CSI to CSI. The special key is only used to avoid | |
310 | --- 1597,1609 ---- | |
311 | } | |
312 | #endif | |
313 | #ifdef FEAT_GUI | |
314 | ! /* Handle focus event here, so that the caller doesn't need to | |
315 | ! * know about it. Return K_IGNORE so that we loop once (needed if | |
316 | ! * 'lazyredraw' is set). */ | |
317 | if (c == K_FOCUSGAINED || c == K_FOCUSLOST) | |
318 | { | |
319 | ui_focus_change(c == K_FOCUSGAINED); | |
320 | ! c = K_IGNORE; | |
321 | } | |
322 | ||
323 | /* Translate K_CSI to CSI. The special key is only used to avoid | |
324 | *************** | |
325 | *** 1744,1749 **** | |
326 | --- 1745,1766 ---- | |
327 | c = vgetc(); | |
328 | if (c == NUL) | |
329 | c = get_keystroke(); | |
330 | + return c; | |
331 | + } | |
332 | + | |
333 | + /* | |
334 | + * Like safe_vgetc(), but loop to handle K_IGNORE. | |
335 | + * Also ignore scrollbar events. | |
336 | + */ | |
337 | + int | |
338 | + plain_vgetc() | |
339 | + { | |
340 | + int c; | |
341 | + | |
342 | + do | |
343 | + { | |
344 | + c = safe_vgetc(); | |
345 | + } while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR); | |
346 | return c; | |
347 | } | |
348 | ||
349 | *** ../vim-7.1.103/src/normal.c Thu Sep 13 15:33:18 2007 | |
350 | --- src/normal.c Thu Sep 13 16:24:51 2007 | |
351 | *************** | |
352 | *** 696,702 **** | |
353 | ++allow_keys; /* no mapping for nchar, but keys */ | |
354 | } | |
355 | ++no_zero_mapping; /* don't map zero here */ | |
356 | ! c = safe_vgetc(); | |
357 | #ifdef FEAT_LANGMAP | |
358 | LANGMAP_ADJUST(c, TRUE); | |
359 | #endif | |
360 | --- 696,702 ---- | |
361 | ++allow_keys; /* no mapping for nchar, but keys */ | |
362 | } | |
363 | ++no_zero_mapping; /* don't map zero here */ | |
364 | ! c = plain_vgetc(); | |
365 | #ifdef FEAT_LANGMAP | |
366 | LANGMAP_ADJUST(c, TRUE); | |
367 | #endif | |
368 | *************** | |
369 | *** 721,727 **** | |
370 | ca.count0 = 0; | |
371 | ++no_mapping; | |
372 | ++allow_keys; /* no mapping for nchar, but keys */ | |
373 | ! c = safe_vgetc(); /* get next character */ | |
374 | #ifdef FEAT_LANGMAP | |
375 | LANGMAP_ADJUST(c, TRUE); | |
376 | #endif | |
377 | --- 721,727 ---- | |
378 | ca.count0 = 0; | |
379 | ++no_mapping; | |
380 | ++allow_keys; /* no mapping for nchar, but keys */ | |
381 | ! c = plain_vgetc(); /* get next character */ | |
382 | #ifdef FEAT_LANGMAP | |
383 | LANGMAP_ADJUST(c, TRUE); | |
384 | #endif | |
385 | *************** | |
386 | *** 900,906 **** | |
387 | * For 'g' get the next character now, so that we can check for | |
388 | * "gr", "g'" and "g`". | |
389 | */ | |
390 | ! ca.nchar = safe_vgetc(); | |
391 | #ifdef FEAT_LANGMAP | |
392 | LANGMAP_ADJUST(ca.nchar, TRUE); | |
393 | #endif | |
394 | --- 900,906 ---- | |
395 | * For 'g' get the next character now, so that we can check for | |
396 | * "gr", "g'" and "g`". | |
397 | */ | |
398 | ! ca.nchar = plain_vgetc(); | |
399 | #ifdef FEAT_LANGMAP | |
400 | LANGMAP_ADJUST(ca.nchar, TRUE); | |
401 | #endif | |
402 | *************** | |
403 | *** 957,963 **** | |
404 | im_set_active(TRUE); | |
405 | #endif | |
406 | ||
407 | ! *cp = safe_vgetc(); | |
408 | ||
409 | if (langmap_active) | |
410 | { | |
411 | --- 957,963 ---- | |
412 | im_set_active(TRUE); | |
413 | #endif | |
414 | ||
415 | ! *cp = plain_vgetc(); | |
416 | ||
417 | if (langmap_active) | |
418 | { | |
419 | *************** | |
420 | *** 1045,1051 **** | |
421 | } | |
422 | if (c > 0) | |
423 | { | |
424 | ! c = safe_vgetc(); | |
425 | if (c != Ctrl_N && c != Ctrl_G) | |
426 | vungetc(c); | |
427 | else | |
428 | --- 1045,1051 ---- | |
429 | } | |
430 | if (c > 0) | |
431 | { | |
432 | ! c = plain_vgetc(); | |
433 | if (c != Ctrl_N && c != Ctrl_G) | |
434 | vungetc(c); | |
435 | else | |
436 | *************** | |
437 | *** 1064,1070 **** | |
438 | while (enc_utf8 && lang && (c = vpeekc()) > 0 | |
439 | && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1)) | |
440 | { | |
441 | ! c = safe_vgetc(); | |
442 | if (!utf_iscomposing(c)) | |
443 | { | |
444 | vungetc(c); /* it wasn't, put it back */ | |
445 | --- 1064,1070 ---- | |
446 | while (enc_utf8 && lang && (c = vpeekc()) > 0 | |
447 | && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1)) | |
448 | { | |
449 | ! c = plain_vgetc(); | |
450 | if (!utf_iscomposing(c)) | |
451 | { | |
452 | vungetc(c); /* it wasn't, put it back */ | |
453 | *************** | |
454 | *** 4564,4570 **** | |
455 | #endif | |
456 | ++no_mapping; | |
457 | ++allow_keys; /* no mapping for nchar, but allow key codes */ | |
458 | ! nchar = safe_vgetc(); | |
459 | #ifdef FEAT_LANGMAP | |
460 | LANGMAP_ADJUST(nchar, TRUE); | |
461 | #endif | |
462 | --- 4564,4570 ---- | |
463 | #endif | |
464 | ++no_mapping; | |
465 | ++allow_keys; /* no mapping for nchar, but allow key codes */ | |
466 | ! nchar = plain_vgetc(); | |
467 | #ifdef FEAT_LANGMAP | |
468 | LANGMAP_ADJUST(nchar, TRUE); | |
469 | #endif | |
470 | *************** | |
471 | *** 4922,4928 **** | |
472 | case 'u': /* "zug" and "zuw": undo "zg" and "zw" */ | |
473 | ++no_mapping; | |
474 | ++allow_keys; /* no mapping for nchar, but allow key codes */ | |
475 | ! nchar = safe_vgetc(); | |
476 | #ifdef FEAT_LANGMAP | |
477 | LANGMAP_ADJUST(nchar, TRUE); | |
478 | #endif | |
479 | --- 4922,4928 ---- | |
480 | case 'u': /* "zug" and "zuw": undo "zg" and "zw" */ | |
481 | ++no_mapping; | |
482 | ++allow_keys; /* no mapping for nchar, but allow key codes */ | |
483 | ! nchar = plain_vgetc(); | |
484 | #ifdef FEAT_LANGMAP | |
485 | LANGMAP_ADJUST(nchar, TRUE); | |
486 | #endif | |
487 | *** ../vim-7.1.103/src/proto/getchar.pro Sun May 6 15:04:24 2007 | |
488 | --- src/proto/getchar.pro Thu Sep 13 16:13:19 2007 | |
489 | *************** | |
490 | *** 38,43 **** | |
491 | --- 38,44 ---- | |
492 | void updatescript __ARGS((int c)); | |
493 | int vgetc __ARGS((void)); | |
494 | int safe_vgetc __ARGS((void)); | |
495 | + int plain_vgetc __ARGS((void)); | |
496 | int vpeekc __ARGS((void)); | |
497 | int vpeekc_nomap __ARGS((void)); | |
498 | int vpeekc_any __ARGS((void)); | |
499 | *** ../vim-7.1.103/src/window.c Sun Aug 12 16:55:01 2007 | |
500 | --- src/window.c Thu Sep 13 16:25:01 2007 | |
501 | *************** | |
502 | *** 584,590 **** | |
503 | ++no_mapping; | |
504 | ++allow_keys; /* no mapping for xchar, but allow key codes */ | |
505 | if (xchar == NUL) | |
506 | ! xchar = safe_vgetc(); | |
507 | #ifdef FEAT_LANGMAP | |
508 | LANGMAP_ADJUST(xchar, TRUE); | |
509 | #endif | |
510 | --- 584,590 ---- | |
511 | ++no_mapping; | |
512 | ++allow_keys; /* no mapping for xchar, but allow key codes */ | |
513 | if (xchar == NUL) | |
514 | ! xchar = plain_vgetc(); | |
515 | #ifdef FEAT_LANGMAP | |
516 | LANGMAP_ADJUST(xchar, TRUE); | |
517 | #endif | |
518 | *** ../vim-7.1.103/src/version.c Thu Sep 13 15:33:18 2007 | |
519 | --- src/version.c Thu Sep 13 18:22:59 2007 | |
520 | *************** | |
521 | *** 668,669 **** | |
522 | --- 668,671 ---- | |
523 | { /* Add new patch number below this line */ | |
524 | + /**/ | |
525 | + 104, | |
526 | /**/ | |
527 | ||
528 | -- | |
529 | ARTHUR: I am your king! | |
530 | WOMAN: Well, I didn't vote for you. | |
531 | ARTHUR: You don't vote for kings. | |
532 | WOMAN: Well, 'ow did you become king then? | |
533 | The Quest for the Holy Grail (Monty Python) | |
534 | ||
535 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
536 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
537 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
538 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |