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