4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
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
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
30 if (c != ESC) /* ESC cancels CTRL-K */
38 if (c != ESC) /* ESC cancels CTRL-K */
47 if (cc != ESC) /* ESC cancels CTRL-K */
55 if (cc != ESC) /* ESC cancels CTRL-K */
58 if (*curbuf->b_p_keymap == NUL)
60 /* Stop any active keymap and clear the table. Also remove
61 ! * b:keymap_unload, as no keymap is active now. */
63 do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
66 if (*curbuf->b_p_keymap == NUL)
68 /* Stop any active keymap and clear the table. Also remove
69 ! * b:keymap_name, as no keymap is active now. */
71 do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
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
83 if (c != Ctrl_N && c != Ctrl_G && c != Ctrl_O)
91 if (c != Ctrl_N && c != Ctrl_G && c != Ctrl_O)
94 #ifdef FEAT_NETBEANS_INTG
95 case K_F21: /* NetBeans command */
96 ++no_mapping; /* don't map the next key hits */
99 netbeans_keycommand(i);
102 #ifdef FEAT_NETBEANS_INTG
103 case K_F21: /* NetBeans command */
104 ++no_mapping; /* don't map the next key hits */
107 netbeans_keycommand(i);
116 ! while (nc == K_IGNORE || nc == K_VER_SCROLLBAR
117 ! || nc == K_HOR_SCROLLBAR);
118 #ifdef FEAT_CMDL_INFO
119 if (!(State & CMDLINE)
125 ! nc = plain_vgetc();
126 #ifdef FEAT_CMDL_INFO
127 if (!(State & CMDLINE)
131 * deleted when ESC is hit.
134 ! regname = safe_vgetc();
136 LANGMAP_ADJUST(regname, TRUE);
139 * deleted when ESC is hit.
142 ! regname = plain_vgetc();
144 LANGMAP_ADJUST(regname, TRUE);
148 #ifdef FEAT_CMDL_INFO
149 add_to_showcmd_c(literally);
151 ! regname = safe_vgetc();
153 LANGMAP_ADJUST(regname, TRUE);
156 #ifdef FEAT_CMDL_INFO
157 add_to_showcmd_c(literally);
159 ! regname = plain_vgetc();
161 LANGMAP_ADJUST(regname, TRUE);
165 * deleted when ESC is hit.
173 * deleted when ESC is hit.
182 * mode message to be deleted when ESC is hit */
188 if (IS_SPECIAL(c) || mod_mask) /* special key */
190 * mode message to be deleted when ESC is hit */
196 if (IS_SPECIAL(c) || mod_mask) /* special key */
210 ! cc = plain_vgetc();
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
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.
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_"
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.
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_"
236 ++no_mapping; /* don't map this key */
237 ++allow_keys; /* allow special keys */
244 ++no_mapping; /* don't map this key */
245 ++allow_keys; /* allow special keys */
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
260 /* CTRL-\ e doesn't work when obtaining an expression. */
268 /* CTRL-\ e doesn't work when obtaining an expression. */
272 putcmdline('"', TRUE);
274 ! i = c = safe_vgetc(); /* CTRL-R <char> */
276 i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */
278 ! c = safe_vgetc(); /* CTRL-R CTRL-R <char> */
284 putcmdline('"', TRUE);
286 ! i = c = plain_vgetc(); /* CTRL-R <char> */
288 i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */
290 ! c = plain_vgetc(); /* CTRL-R CTRL-R <char> */
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
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)
305 ui_focus_change(c == K_FOCUSGAINED);
309 /* Translate K_CSI to CSI. The special key is only used to avoid
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)
319 ui_focus_change(c == K_FOCUSGAINED);
323 /* Translate K_CSI to CSI. The special key is only used to avoid
334 + * Like safe_vgetc(), but loop to handle K_IGNORE.
335 + * Also ignore scrollbar events.
345 + } while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
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
353 ++allow_keys; /* no mapping for nchar, but keys */
355 ++no_zero_mapping; /* don't map zero here */
358 LANGMAP_ADJUST(c, TRUE);
361 ++allow_keys; /* no mapping for nchar, but keys */
363 ++no_zero_mapping; /* don't map zero here */
366 LANGMAP_ADJUST(c, TRUE);
372 ++allow_keys; /* no mapping for nchar, but keys */
373 ! c = safe_vgetc(); /* get next character */
375 LANGMAP_ADJUST(c, TRUE);
380 ++allow_keys; /* no mapping for nchar, but keys */
381 ! c = plain_vgetc(); /* get next character */
383 LANGMAP_ADJUST(c, TRUE);
387 * For 'g' get the next character now, so that we can check for
388 * "gr", "g'" and "g`".
390 ! ca.nchar = safe_vgetc();
392 LANGMAP_ADJUST(ca.nchar, TRUE);
395 * For 'g' get the next character now, so that we can check for
396 * "gr", "g'" and "g`".
398 ! ca.nchar = plain_vgetc();
400 LANGMAP_ADJUST(ca.nchar, TRUE);
407 ! *cp = safe_vgetc();
415 ! *cp = plain_vgetc();
425 if (c != Ctrl_N && c != Ctrl_G)
433 if (c != Ctrl_N && c != Ctrl_G)
438 while (enc_utf8 && lang && (c = vpeekc()) > 0
439 && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1))
442 if (!utf_iscomposing(c))
444 vungetc(c); /* it wasn't, put it back */
446 while (enc_utf8 && lang && (c = vpeekc()) > 0
447 && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1))
450 if (!utf_iscomposing(c))
452 vungetc(c); /* it wasn't, put it back */
457 ++allow_keys; /* no mapping for nchar, but allow key codes */
458 ! nchar = safe_vgetc();
460 LANGMAP_ADJUST(nchar, TRUE);
465 ++allow_keys; /* no mapping for nchar, but allow key codes */
466 ! nchar = plain_vgetc();
468 LANGMAP_ADJUST(nchar, TRUE);
472 case 'u': /* "zug" and "zuw": undo "zg" and "zw" */
474 ++allow_keys; /* no mapping for nchar, but allow key codes */
475 ! nchar = safe_vgetc();
477 LANGMAP_ADJUST(nchar, TRUE);
480 case 'u': /* "zug" and "zuw": undo "zg" and "zw" */
482 ++allow_keys; /* no mapping for nchar, but allow key codes */
483 ! nchar = plain_vgetc();
485 LANGMAP_ADJUST(nchar, TRUE);
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
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
504 ++allow_keys; /* no mapping for xchar, but allow key codes */
506 ! xchar = safe_vgetc();
508 LANGMAP_ADJUST(xchar, TRUE);
512 ++allow_keys; /* no mapping for xchar, but allow key codes */
514 ! xchar = plain_vgetc();
516 LANGMAP_ADJUST(xchar, TRUE);
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
523 { /* Add new patch number below this line */
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)
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 ///