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.4 / 7.4.569 < prev    next >
Encoding:
Internet Message Format  |  2015-01-14  |  5.0 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.569
  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.4.569 (after 7.4.468)
  11. Problem:    Having CTRL-C interrupt or not does not check the mode of the
  12.         mapping. (Ingo Karkat)
  13. Solution:   Use a bitmask with the map mode. (Christian Brabandt)
  14. Files:        src/getchar.c, src/structs.h, src/testdir/test_mapping.in,
  15.         src/testdir/test_mapping.ok, src/ui.c, src/globals.h
  16.  
  17.  
  18. *** ../vim-7.4.568/src/getchar.c    2014-12-14 00:43:50.335749455 +0100
  19. --- src/getchar.c    2015-01-14 12:13:13.136016098 +0100
  20. ***************
  21. *** 3708,3715 ****
  22.       if (!did_it)
  23.           retval = 2;                /* no match */
  24.       else if (*keys == Ctrl_C)
  25.           /* If CTRL-C has been unmapped, reuse it for Interrupting. */
  26. !         mapped_ctrl_c = FALSE;
  27.       goto theend;
  28.       }
  29.   
  30. --- 3708,3720 ----
  31.       if (!did_it)
  32.           retval = 2;                /* no match */
  33.       else if (*keys == Ctrl_C)
  34. +     {
  35.           /* If CTRL-C has been unmapped, reuse it for Interrupting. */
  36. !         if (map_table == curbuf->b_maphash)
  37. !         curbuf->b_mapped_ctrl_c &= ~mode;
  38. !         else
  39. !         mapped_ctrl_c &= ~mode;
  40. !     }
  41.       goto theend;
  42.       }
  43.   
  44. ***************
  45. *** 3744,3750 ****
  46.   
  47.       /* If CTRL-C has been mapped, don't always use it for Interrupting. */
  48.       if (*keys == Ctrl_C)
  49. !     mapped_ctrl_c = TRUE;
  50.   
  51.       mp->m_keys = vim_strsave(keys);
  52.       mp->m_str = vim_strsave(rhs);
  53. --- 3749,3760 ----
  54.   
  55.       /* If CTRL-C has been mapped, don't always use it for Interrupting. */
  56.       if (*keys == Ctrl_C)
  57. !     {
  58. !     if (map_table == curbuf->b_maphash)
  59. !         curbuf->b_mapped_ctrl_c |= mode;
  60. !     else
  61. !         mapped_ctrl_c |= mode;
  62. !     }
  63.   
  64.       mp->m_keys = vim_strsave(keys);
  65.       mp->m_str = vim_strsave(rhs);
  66. *** ../vim-7.4.568/src/structs.h    2014-09-23 15:45:04.874801055 +0200
  67. --- src/structs.h    2015-01-14 12:15:33.582480344 +0100
  68. ***************
  69. *** 1802,1807 ****
  70. --- 1802,1808 ----
  71.       cryptstate_T *b_cryptstate;    /* Encryption state while reading or writing
  72.                    * the file. NULL when not using encryption. */
  73.   #endif
  74. +     int        b_mapped_ctrl_c; /* modes where CTRL-C is mapped */
  75.   
  76.   }; /* file_buffer */
  77.   
  78. *** ../vim-7.4.568/src/testdir/test_mapping.in    2014-12-14 00:43:50.335749455 +0100
  79. --- src/testdir/test_mapping.in    2015-01-14 12:11:14.197316987 +0100
  80. ***************
  81. *** 8,13 ****
  82. --- 8,22 ----
  83.   :inoreab ╤ç╨║╨┐╤Ç   vim
  84.   GA╤ç╨║╨┐╤Ç 
  85.   
  86. + :" mapping of ctrl-c in insert mode
  87. + :set cpo-=< cpo-=k
  88. + :inoremap <c-c> <ctrl-c>
  89. + :cnoremap <c-c> dummy
  90. + :cunmap <c-c>
  91. + GA
  92. + TEST2: CTRL-C |A|
  93. + :nunmap <c-c>
  94.   
  95.   : " langmap should not get remapped in insert mode
  96.   :inoremap { FAIL_ilangmap
  97. *** ../vim-7.4.568/src/testdir/test_mapping.ok    2014-12-14 00:43:50.335749455 +0100
  98. --- src/testdir/test_mapping.ok    2015-01-14 12:11:14.197316987 +0100
  99. ***************
  100. *** 1,4 ****
  101. --- 1,6 ----
  102.   test starts here:
  103.   vim
  104. + TEST2: CTRL-C |<ctrl-c>A|
  105.   +
  106.   +
  107. *** ../vim-7.4.568/src/ui.c    2014-09-19 13:46:49.550399801 +0200
  108. --- src/ui.c    2015-01-14 12:18:23.888618642 +0100
  109. ***************
  110. *** 180,186 ****
  111.   
  112.       /* ... there is no need for CTRL-C to interrupt something, don't let
  113.        * it set got_int when it was mapped. */
  114. !     if (mapped_ctrl_c)
  115.           ctrl_c_interrupts = FALSE;
  116.       }
  117.   
  118. --- 180,186 ----
  119.   
  120.       /* ... there is no need for CTRL-C to interrupt something, don't let
  121.        * it set got_int when it was mapped. */
  122. !     if ((mapped_ctrl_c | curbuf->b_mapped_ctrl_c) & State)
  123.           ctrl_c_interrupts = FALSE;
  124.       }
  125.   
  126. *** ../vim-7.4.568/src/globals.h    2014-08-10 13:34:59.056785459 +0200
  127. --- src/globals.h    2015-01-14 12:13:58.959514980 +0100
  128. ***************
  129. *** 958,964 ****
  130.   #ifdef USE_ON_FLY_SCROLL
  131.   EXTERN int    dont_scroll INIT(= FALSE);/* don't use scrollbars when TRUE */
  132.   #endif
  133. ! EXTERN int    mapped_ctrl_c INIT(= FALSE); /* CTRL-C is mapped */
  134.   EXTERN int    ctrl_c_interrupts INIT(= TRUE);    /* CTRL-C sets got_int */
  135.   
  136.   EXTERN cmdmod_T    cmdmod;            /* Ex command modifiers */
  137. --- 958,964 ----
  138.   #ifdef USE_ON_FLY_SCROLL
  139.   EXTERN int    dont_scroll INIT(= FALSE);/* don't use scrollbars when TRUE */
  140.   #endif
  141. ! EXTERN int    mapped_ctrl_c INIT(= FALSE); /* modes where CTRL-C is mapped */
  142.   EXTERN int    ctrl_c_interrupts INIT(= TRUE);    /* CTRL-C sets got_int */
  143.   
  144.   EXTERN cmdmod_T    cmdmod;            /* Ex command modifiers */
  145. *** ../vim-7.4.568/src/version.c    2015-01-14 11:24:51.851582151 +0100
  146. --- src/version.c    2015-01-14 12:12:04.728764264 +0100
  147. ***************
  148. *** 743,744 ****
  149. --- 743,746 ----
  150.   {   /* Add new patch number below this line */
  151. + /**/
  152. +     569,
  153.   /**/
  154.  
  155. -- 
  156. hundred-and-one symptoms of being an internet addict:
  157. 85. Choice between paying Compuserve bill and paying for kids education
  158.     is a no brainer -- although a bit painful for your kids.
  159.  
  160.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  161. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  162. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  163.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  164.