home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.1 / 7.1.104 < prev    next >
Encoding:
Internet Message Format  |  2007-11-19  |  14.0 KB

  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. +  * Like safe_vgetc(), but loop to handle K_IGNORE.
  334. +  * Also ignore scrollbar events.
  335. +  */
  336. +     int
  337. + plain_vgetc()
  338. + {
  339. +     int c;
  340. +     do
  341. +     {
  342. +     c = safe_vgetc();
  343. +     } while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
  344.       return c;
  345.   }
  346.   
  347. *** ../vim-7.1.103/src/normal.c    Thu Sep 13 15:33:18 2007
  348. --- src/normal.c    Thu Sep 13 16:24:51 2007
  349. ***************
  350. *** 696,702 ****
  351.           ++allow_keys;        /* no mapping for nchar, but keys */
  352.           }
  353.           ++no_zero_mapping;        /* don't map zero here */
  354. !         c = safe_vgetc();
  355.   #ifdef FEAT_LANGMAP
  356.           LANGMAP_ADJUST(c, TRUE);
  357.   #endif
  358. --- 696,702 ----
  359.           ++allow_keys;        /* no mapping for nchar, but keys */
  360.           }
  361.           ++no_zero_mapping;        /* don't map zero here */
  362. !         c = plain_vgetc();
  363.   #ifdef FEAT_LANGMAP
  364.           LANGMAP_ADJUST(c, TRUE);
  365.   #endif
  366. ***************
  367. *** 721,727 ****
  368.           ca.count0 = 0;
  369.           ++no_mapping;
  370.           ++allow_keys;        /* no mapping for nchar, but keys */
  371. !         c = safe_vgetc();        /* get next character */
  372.   #ifdef FEAT_LANGMAP
  373.           LANGMAP_ADJUST(c, TRUE);
  374.   #endif
  375. --- 721,727 ----
  376.           ca.count0 = 0;
  377.           ++no_mapping;
  378.           ++allow_keys;        /* no mapping for nchar, but keys */
  379. !         c = plain_vgetc();        /* get next character */
  380.   #ifdef FEAT_LANGMAP
  381.           LANGMAP_ADJUST(c, TRUE);
  382.   #endif
  383. ***************
  384. *** 900,906 ****
  385.            * For 'g' get the next character now, so that we can check for
  386.            * "gr", "g'" and "g`".
  387.            */
  388. !         ca.nchar = safe_vgetc();
  389.   #ifdef FEAT_LANGMAP
  390.           LANGMAP_ADJUST(ca.nchar, TRUE);
  391.   #endif
  392. --- 900,906 ----
  393.            * For 'g' get the next character now, so that we can check for
  394.            * "gr", "g'" and "g`".
  395.            */
  396. !         ca.nchar = plain_vgetc();
  397.   #ifdef FEAT_LANGMAP
  398.           LANGMAP_ADJUST(ca.nchar, TRUE);
  399.   #endif
  400. ***************
  401. *** 957,963 ****
  402.           im_set_active(TRUE);
  403.   #endif
  404.   
  405. !         *cp = safe_vgetc();
  406.   
  407.           if (langmap_active)
  408.           {
  409. --- 957,963 ----
  410.           im_set_active(TRUE);
  411.   #endif
  412.   
  413. !         *cp = plain_vgetc();
  414.   
  415.           if (langmap_active)
  416.           {
  417. ***************
  418. *** 1045,1051 ****
  419.           }
  420.           if (c > 0)
  421.           {
  422. !             c = safe_vgetc();
  423.               if (c != Ctrl_N && c != Ctrl_G)
  424.               vungetc(c);
  425.               else
  426. --- 1045,1051 ----
  427.           }
  428.           if (c > 0)
  429.           {
  430. !             c = plain_vgetc();
  431.               if (c != Ctrl_N && c != Ctrl_G)
  432.               vungetc(c);
  433.               else
  434. ***************
  435. *** 1064,1070 ****
  436.           while (enc_utf8 && lang && (c = vpeekc()) > 0
  437.                    && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1))
  438.           {
  439. !         c = safe_vgetc();
  440.           if (!utf_iscomposing(c))
  441.           {
  442.               vungetc(c);        /* it wasn't, put it back */
  443. --- 1064,1070 ----
  444.           while (enc_utf8 && lang && (c = vpeekc()) > 0
  445.                    && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1))
  446.           {
  447. !         c = plain_vgetc();
  448.           if (!utf_iscomposing(c))
  449.           {
  450.               vungetc(c);        /* it wasn't, put it back */
  451. ***************
  452. *** 4564,4570 ****
  453.   #endif
  454.           ++no_mapping;
  455.           ++allow_keys;   /* no mapping for nchar, but allow key codes */
  456. !         nchar = safe_vgetc();
  457.   #ifdef FEAT_LANGMAP
  458.           LANGMAP_ADJUST(nchar, TRUE);
  459.   #endif
  460. --- 4564,4570 ----
  461.   #endif
  462.           ++no_mapping;
  463.           ++allow_keys;   /* no mapping for nchar, but allow key codes */
  464. !         nchar = plain_vgetc();
  465.   #ifdef FEAT_LANGMAP
  466.           LANGMAP_ADJUST(nchar, TRUE);
  467.   #endif
  468. ***************
  469. *** 4922,4928 ****
  470.       case 'u':    /* "zug" and "zuw": undo "zg" and "zw" */
  471.           ++no_mapping;
  472.           ++allow_keys;   /* no mapping for nchar, but allow key codes */
  473. !         nchar = safe_vgetc();
  474.   #ifdef FEAT_LANGMAP
  475.           LANGMAP_ADJUST(nchar, TRUE);
  476.   #endif
  477. --- 4922,4928 ----
  478.       case 'u':    /* "zug" and "zuw": undo "zg" and "zw" */
  479.           ++no_mapping;
  480.           ++allow_keys;   /* no mapping for nchar, but allow key codes */
  481. !         nchar = plain_vgetc();
  482.   #ifdef FEAT_LANGMAP
  483.           LANGMAP_ADJUST(nchar, TRUE);
  484.   #endif
  485. *** ../vim-7.1.103/src/proto/getchar.pro    Sun May  6 15:04:24 2007
  486. --- src/proto/getchar.pro    Thu Sep 13 16:13:19 2007
  487. ***************
  488. *** 38,43 ****
  489. --- 38,44 ----
  490.   void updatescript __ARGS((int c));
  491.   int vgetc __ARGS((void));
  492.   int safe_vgetc __ARGS((void));
  493. + int plain_vgetc __ARGS((void));
  494.   int vpeekc __ARGS((void));
  495.   int vpeekc_nomap __ARGS((void));
  496.   int vpeekc_any __ARGS((void));
  497. *** ../vim-7.1.103/src/window.c    Sun Aug 12 16:55:01 2007
  498. --- src/window.c    Thu Sep 13 16:25:01 2007
  499. ***************
  500. *** 584,590 ****
  501.           ++no_mapping;
  502.           ++allow_keys;   /* no mapping for xchar, but allow key codes */
  503.           if (xchar == NUL)
  504. !             xchar = safe_vgetc();
  505.   #ifdef FEAT_LANGMAP
  506.           LANGMAP_ADJUST(xchar, TRUE);
  507.   #endif
  508. --- 584,590 ----
  509.           ++no_mapping;
  510.           ++allow_keys;   /* no mapping for xchar, but allow key codes */
  511.           if (xchar == NUL)
  512. !             xchar = plain_vgetc();
  513.   #ifdef FEAT_LANGMAP
  514.           LANGMAP_ADJUST(xchar, TRUE);
  515.   #endif
  516. *** ../vim-7.1.103/src/version.c    Thu Sep 13 15:33:18 2007
  517. --- src/version.c    Thu Sep 13 18:22:59 2007
  518. ***************
  519. *** 668,669 ****
  520. --- 668,671 ----
  521.   {   /* Add new patch number below this line */
  522. + /**/
  523. +     104,
  524.   /**/
  525.  
  526. -- 
  527. ARTHUR:  I am your king!
  528. WOMAN:   Well, I didn't vote for you.
  529. ARTHUR:  You don't vote for kings.
  530. WOMAN:   Well, 'ow did you become king then?
  531.                                   The Quest for the Holy Grail (Monty Python)
  532.  
  533.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  534. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  535. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  536.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  537.