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.3 / 7.3.429 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  5.3 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.429
  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.429
  11. Problem:    When 'cpoptions' includes "E" "c0" in the first column is an
  12.             error. The redo register is then set to the errornous command.
  13. Solution:   Do not set the redo register if the command fails because of an
  14.             empty region. (Hideki Eiraku)
  15. Files:      src/getchar.c, src/normal.c, src/proto/getchar.pro
  16.  
  17.  
  18. *** ../vim-7.3.428/src/getchar.c    2012-01-10 22:26:12.000000000 +0100
  19. --- src/getchar.c    2012-02-05 01:05:09.000000000 +0100
  20. ***************
  21. *** 470,475 ****
  22. --- 470,493 ----
  23.       }
  24.   }
  25.   
  26. + /*
  27. +  * Discard the contents of the redo buffer and restore the previous redo
  28. +  * buffer.
  29. +  */
  30. +     void
  31. + CancelRedo()
  32. + {
  33. +     if (!block_redo)
  34. +     {
  35. +     free_buff(&redobuff);
  36. +     redobuff = old_redobuff;
  37. +     old_redobuff.bh_first.b_next = NULL;
  38. +     start_stuff();
  39. +     while (read_stuff(TRUE) != NUL)
  40. +         ;
  41. +     }
  42. + }
  43.   #if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
  44.   /*
  45.    * Save redobuff and old_redobuff to save_redobuff and save_old_redobuff.
  46. ***************
  47. *** 691,699 ****
  48.    * Read a character from the redo buffer.  Translates K_SPECIAL, CSI and
  49.    * multibyte characters.
  50.    * The redo buffer is left as it is.
  51. !  * if init is TRUE, prepare for redo, return FAIL if nothing to redo, OK
  52. !  * otherwise
  53. !  * if old is TRUE, use old_redobuff instead of redobuff
  54.    */
  55.       static int
  56.   read_redo(init, old_redo)
  57. --- 709,717 ----
  58.    * Read a character from the redo buffer.  Translates K_SPECIAL, CSI and
  59.    * multibyte characters.
  60.    * The redo buffer is left as it is.
  61. !  * If init is TRUE, prepare for redo, return FAIL if nothing to redo, OK
  62. !  * otherwise.
  63. !  * If old is TRUE, use old_redobuff instead of redobuff.
  64.    */
  65.       static int
  66.   read_redo(init, old_redo)
  67. *** ../vim-7.3.428/src/normal.c    2012-01-26 11:43:04.000000000 +0100
  68. --- src/normal.c    2012-02-05 01:06:01.000000000 +0100
  69. ***************
  70. *** 1978,1984 ****
  71. --- 1978,1987 ----
  72.           VIsual_reselect = FALSE;        /* don't reselect now */
  73.   #endif
  74.           if (empty_region_error)
  75. +         {
  76.           vim_beep();
  77. +         CancelRedo();
  78. +         }
  79.           else
  80.           {
  81.           (void)op_delete(oap);
  82. ***************
  83. *** 1992,1998 ****
  84. --- 1995,2004 ----
  85.           if (empty_region_error)
  86.           {
  87.           if (!gui_yank)
  88. +         {
  89.               vim_beep();
  90. +             CancelRedo();
  91. +         }
  92.           }
  93.           else
  94.           (void)op_yank(oap, FALSE, !gui_yank);
  95. ***************
  96. *** 2004,2010 ****
  97. --- 2010,2019 ----
  98.           VIsual_reselect = FALSE;        /* don't reselect now */
  99.   #endif
  100.           if (empty_region_error)
  101. +         {
  102.           vim_beep();
  103. +         CancelRedo();
  104. +         }
  105.           else
  106.           {
  107.           /* This is a new edit command, not a restart.  Need to
  108. ***************
  109. *** 2066,2072 ****
  110. --- 2075,2084 ----
  111.       case OP_LOWER:
  112.       case OP_ROT13:
  113.           if (empty_region_error)
  114. +         {
  115.           vim_beep();
  116. +         CancelRedo();
  117. +         }
  118.           else
  119.           op_tilde(oap);
  120.           check_cursor_col();
  121. ***************
  122. *** 2099,2105 ****
  123. --- 2111,2120 ----
  124.   #endif
  125.   #ifdef FEAT_VISUALEXTRA
  126.           if (empty_region_error)
  127. +         {
  128.           vim_beep();
  129. +         CancelRedo();
  130. +         }
  131.           else
  132.           {
  133.           /* This is a new edit command, not a restart.  Need to
  134. ***************
  135. *** 2129,2135 ****
  136. --- 2144,2153 ----
  137.   #ifdef FEAT_VISUALEXTRA
  138.           if (empty_region_error)
  139.   #endif
  140. +         {
  141.           vim_beep();
  142. +         CancelRedo();
  143. +         }
  144.   #ifdef FEAT_VISUALEXTRA
  145.           else
  146.           op_replace(oap, cap->nchar);
  147. *** ../vim-7.3.428/src/proto/getchar.pro    2010-10-20 21:22:17.000000000 +0200
  148. --- src/proto/getchar.pro    2012-02-05 01:05:20.000000000 +0100
  149. ***************
  150. *** 4,11 ****
  151.   char_u *get_inserted __ARGS((void));
  152.   int stuff_empty __ARGS((void));
  153.   void typeahead_noflush __ARGS((int c));
  154. ! void flush_buffers __ARGS((int typeahead));
  155.   void ResetRedobuff __ARGS((void));
  156.   void saveRedobuff __ARGS((void));
  157.   void restoreRedobuff __ARGS((void));
  158.   void AppendToRedobuff __ARGS((char_u *s));
  159. --- 4,12 ----
  160.   char_u *get_inserted __ARGS((void));
  161.   int stuff_empty __ARGS((void));
  162.   void typeahead_noflush __ARGS((int c));
  163. ! void flush_buffers __ARGS((int flush_typeahead));
  164.   void ResetRedobuff __ARGS((void));
  165. + void CancelRedo __ARGS((void));
  166.   void saveRedobuff __ARGS((void));
  167.   void restoreRedobuff __ARGS((void));
  168.   void AppendToRedobuff __ARGS((char_u *s));
  169. *** ../vim-7.3.428/src/version.c    2012-02-05 00:47:56.000000000 +0100
  170. --- src/version.c    2012-02-05 01:09:23.000000000 +0100
  171. ***************
  172. *** 716,717 ****
  173. --- 716,719 ----
  174.   {   /* Add new patch number below this line */
  175. + /**/
  176. +     429,
  177.   /**/
  178.  
  179. -- 
  180. The History of every major Galactic Civilization tends to pass through
  181. three distinct and recognizable phases, those of Survival, Inquiry and
  182. Sophistication, otherwise known as the How, Why and Where phases.
  183. For instance, the first phase is characterized by the question 'How can
  184. we eat?' the second by the question 'Why do we eat?' and the third by
  185. the question 'Where shall we have lunch?'
  186.         -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
  187.  
  188.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  189. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  190. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  191.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  192.