Mirror of the Vim source from https://github.com/vim/vim
リビジョン | a66a49322b6bc2a82c6cc3e8092db7d502f64c4b (tree) |
---|---|
日時 | 2007-08-15 05:16:42 |
作者 | vimboss |
コミッター | vimboss |
updated for version 7.1-073
@@ -104,7 +104,7 @@ | ||
104 | 104 | int ind_done = 0; /* measured in spaces */ |
105 | 105 | int tab_pad; |
106 | 106 | int retval = FALSE; |
107 | - int orig_char_len = 0; /* number of initial whitespace chars when | |
107 | + int orig_char_len = -1; /* number of initial whitespace chars when | |
108 | 108 | 'et' and 'pi' are both set */ |
109 | 109 | |
110 | 110 | /* |
@@ -159,7 +159,7 @@ | ||
159 | 159 | |
160 | 160 | /* Fill to next tabstop with a tab, if possible */ |
161 | 161 | tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts); |
162 | - if (todo >= tab_pad && orig_char_len == 0) | |
162 | + if (todo >= tab_pad && orig_char_len == -1) | |
163 | 163 | { |
164 | 164 | doit = TRUE; |
165 | 165 | todo -= tab_pad; |
@@ -206,11 +206,15 @@ | ||
206 | 206 | /* If 'preserveindent' and 'expandtab' are both set keep the original |
207 | 207 | * characters and allocate accordingly. We will fill the rest with spaces |
208 | 208 | * after the if (!curbuf->b_p_et) below. */ |
209 | - if (orig_char_len != 0) | |
209 | + if (orig_char_len != -1) | |
210 | 210 | { |
211 | 211 | newline = alloc(orig_char_len + size - ind_done + line_len); |
212 | 212 | if (newline == NULL) |
213 | 213 | return FALSE; |
214 | + todo = size - ind_done; | |
215 | + ind_len = orig_char_len + todo; /* Set total length of indent in | |
216 | + * characters, which may have been | |
217 | + * undercounted until now */ | |
214 | 218 | p = oldline; |
215 | 219 | s = newline; |
216 | 220 | while (orig_char_len > 0) |
@@ -222,9 +226,6 @@ | ||
222 | 226 | * than old) */ |
223 | 227 | while (vim_iswhite(*p)) |
224 | 228 | (void)*p++; |
225 | - todo = size - ind_done; | |
226 | - ind_len += todo; /* Set total length of indent in characters, | |
227 | - * which may have been undercounted until now */ | |
228 | 229 | |
229 | 230 | } |
230 | 231 | else |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 73, | |
671 | +/**/ | |
670 | 672 | 72, |
671 | 673 | /**/ |
672 | 674 | 71, |