Mercurial > vim
comparison src/misc1.c @ 835:8bebcabccc2c v7.0e01
updated for version 7.0e01
author | vimboss |
---|---|
date | Mon, 17 Apr 2006 22:14:47 +0000 |
parents | 5117153003bd |
children | 8e5830943bff |
comparison
equal
deleted
inserted
replaced
834:5117153003bd | 835:8bebcabccc2c |
---|---|
261 if (flags & SIN_CHANGED) | 261 if (flags & SIN_CHANGED) |
262 changed_bytes(curwin->w_cursor.lnum, 0); | 262 changed_bytes(curwin->w_cursor.lnum, 0); |
263 /* Correct saved cursor position if it's after the indent. */ | 263 /* Correct saved cursor position if it's after the indent. */ |
264 if (saved_cursor.lnum == curwin->w_cursor.lnum | 264 if (saved_cursor.lnum == curwin->w_cursor.lnum |
265 && saved_cursor.col >= (colnr_T)(p - oldline)) | 265 && saved_cursor.col >= (colnr_T)(p - oldline)) |
266 saved_cursor.col += ind_len - (p - oldline); | 266 saved_cursor.col += ind_len - (colnr_T)(p - oldline); |
267 retval = TRUE; | 267 retval = TRUE; |
268 } | 268 } |
269 else | 269 else |
270 vim_free(newline); | 270 vim_free(newline); |
271 | 271 |
1011 while (old_size < repl_size && p > leader) | 1011 while (old_size < repl_size && p > leader) |
1012 { | 1012 { |
1013 mb_ptr_back(leader, p); | 1013 mb_ptr_back(leader, p); |
1014 old_size += ptr2cells(p); | 1014 old_size += ptr2cells(p); |
1015 } | 1015 } |
1016 l = lead_repl_len - (endp - p); | 1016 l = lead_repl_len - (int)(endp - p); |
1017 if (l != 0) | 1017 if (l != 0) |
1018 mch_memmove(endp + l, endp, | 1018 mch_memmove(endp + l, endp, |
1019 (size_t)((leader + lead_len) - endp)); | 1019 (size_t)((leader + lead_len) - endp)); |
1020 lead_len += l; | 1020 lead_len += l; |
1021 } | 1021 } |
3416 int len; | 3416 int len; |
3417 char_u *pp; | 3417 char_u *pp; |
3418 | 3418 |
3419 /* Convert from active codepage to UTF-8. Other conversions are | 3419 /* Convert from active codepage to UTF-8. Other conversions are |
3420 * not done, because they would fail for non-ASCII characters. */ | 3420 * not done, because they would fail for non-ASCII characters. */ |
3421 acp_to_enc(var, STRLEN(var), &pp, &len); | 3421 acp_to_enc(var, (int)STRLEN(var), &pp, &len); |
3422 if (pp != NULL) | 3422 if (pp != NULL) |
3423 { | 3423 { |
3424 homedir = pp; | 3424 homedir = pp; |
3425 return; | 3425 return; |
3426 } | 3426 } |
3495 int mustfree; /* var was allocated, need to free it later */ | 3495 int mustfree; /* var was allocated, need to free it later */ |
3496 int at_start = TRUE; /* at start of a name */ | 3496 int at_start = TRUE; /* at start of a name */ |
3497 int startstr_len = 0; | 3497 int startstr_len = 0; |
3498 | 3498 |
3499 if (startstr != NULL) | 3499 if (startstr != NULL) |
3500 startstr_len = STRLEN(startstr); | 3500 startstr_len = (int)STRLEN(startstr); |
3501 | 3501 |
3502 src = skipwhite(srcp); | 3502 src = skipwhite(srcp); |
3503 --dstlen; /* leave one char space for "\," */ | 3503 --dstlen; /* leave one char space for "\," */ |
3504 while (*src && dstlen > 0) | 3504 while (*src && dstlen > 0) |
3505 { | 3505 { |
3703 if (var != NULL && *var != NUL | 3703 if (var != NULL && *var != NUL |
3704 && (STRLEN(var) + STRLEN(tail) + 1 < (unsigned)dstlen)) | 3704 && (STRLEN(var) + STRLEN(tail) + 1 < (unsigned)dstlen)) |
3705 { | 3705 { |
3706 STRCPY(dst, var); | 3706 STRCPY(dst, var); |
3707 dstlen -= (int)STRLEN(var); | 3707 dstlen -= (int)STRLEN(var); |
3708 c = STRLEN(var); | 3708 c = (int)STRLEN(var); |
3709 /* if var[] ends in a path separator and tail[] starts | 3709 /* if var[] ends in a path separator and tail[] starts |
3710 * with it, skip a character */ | 3710 * with it, skip a character */ |
3711 if (*var != NUL && after_pathsep(dst, dst + c) | 3711 if (*var != NUL && after_pathsep(dst, dst + c) |
3712 #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) | 3712 #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) |
3713 && dst[-1] != ':' | 3713 && dst[-1] != ':' |
3778 int len; | 3778 int len; |
3779 char_u *pp; | 3779 char_u *pp; |
3780 | 3780 |
3781 /* Convert from active codepage to UTF-8. Other conversions are | 3781 /* Convert from active codepage to UTF-8. Other conversions are |
3782 * not done, because they would fail for non-ASCII characters. */ | 3782 * not done, because they would fail for non-ASCII characters. */ |
3783 acp_to_enc(p, STRLEN(p), &pp, &len); | 3783 acp_to_enc(p, (int)STRLEN(p), &pp, &len); |
3784 if (pp != NULL) | 3784 if (pp != NULL) |
3785 { | 3785 { |
3786 p = pp; | 3786 p = pp; |
3787 *mustfree = TRUE; | 3787 *mustfree = TRUE; |
3788 } | 3788 } |
3823 char_u *pp; | 3823 char_u *pp; |
3824 | 3824 |
3825 /* Convert from active codepage to UTF-8. Other conversions | 3825 /* Convert from active codepage to UTF-8. Other conversions |
3826 * are not done, because they would fail for non-ASCII | 3826 * are not done, because they would fail for non-ASCII |
3827 * characters. */ | 3827 * characters. */ |
3828 acp_to_enc(p, STRLEN(p), &pp, &len); | 3828 acp_to_enc(p, (int)STRLEN(p), &pp, &len); |
3829 if (pp != NULL) | 3829 if (pp != NULL) |
3830 { | 3830 { |
3831 if (mustfree) | 3831 if (mustfree) |
3832 vim_free(p); | 3832 vim_free(p); |
3833 p = pp; | 3833 p = pp; |
5142 pos_T fp; | 5142 pos_T fp; |
5143 colnr_T col; | 5143 colnr_T col; |
5144 | 5144 |
5145 line = ml_get_curline(); | 5145 line = ml_get_curline(); |
5146 p = skipwhite(line); | 5146 p = skipwhite(line); |
5147 len = skiptowhite(p) - p; | 5147 len = (int)(skiptowhite(p) - p); |
5148 if (len == 6 && STRNCMP(p, "static", 6) == 0) | 5148 if (len == 6 && STRNCMP(p, "static", 6) == 0) |
5149 { | 5149 { |
5150 p = skipwhite(p + 6); | 5150 p = skipwhite(p + 6); |
5151 len = skiptowhite(p) - p; | 5151 len = (int)(skiptowhite(p) - p); |
5152 } | 5152 } |
5153 if (len == 6 && STRNCMP(p, "struct", 6) == 0) | 5153 if (len == 6 && STRNCMP(p, "struct", 6) == 0) |
5154 p = skipwhite(p + 6); | 5154 p = skipwhite(p + 6); |
5155 else if (len == 4 && STRNCMP(p, "enum", 4) == 0) | 5155 else if (len == 4 && STRNCMP(p, "enum", 4) == 0) |
5156 p = skipwhite(p + 4); | 5156 p = skipwhite(p + 4); |
5487 s = skipwhite(p + 1); | 5487 s = skipwhite(p + 1); |
5488 if (*s == ';' && cin_nocode(s + 1)) | 5488 if (*s == ';' && cin_nocode(s + 1)) |
5489 { | 5489 { |
5490 /* Found ");" at end of the line, now check there is "while" | 5490 /* Found ");" at end of the line, now check there is "while" |
5491 * before the matching '('. XXX */ | 5491 * before the matching '('. XXX */ |
5492 i = p - line; | 5492 i = (int)(p - line); |
5493 curwin->w_cursor.col = i; | 5493 curwin->w_cursor.col = i; |
5494 trypos = find_match_paren(ind_maxparen, ind_maxcomment); | 5494 trypos = find_match_paren(ind_maxparen, ind_maxcomment); |
5495 if (trypos != NULL) | 5495 if (trypos != NULL) |
5496 { | 5496 { |
5497 s = cin_skipcomment(ml_get(trypos->lnum)); | 5497 s = cin_skipcomment(ml_get(trypos->lnum)); |
6466 | 6466 |
6467 /* Ignore a '(' in front of the line that has a match before | 6467 /* Ignore a '(' in front of the line that has a match before |
6468 * our matching '('. */ | 6468 * our matching '('. */ |
6469 curwin->w_cursor.lnum = our_paren_pos.lnum; | 6469 curwin->w_cursor.lnum = our_paren_pos.lnum; |
6470 line = ml_get_curline(); | 6470 line = ml_get_curline(); |
6471 look_col = look - line; | 6471 look_col = (int)(look - line); |
6472 curwin->w_cursor.col = look_col + 1; | 6472 curwin->w_cursor.col = look_col + 1; |
6473 if ((trypos = findmatchlimit(NULL, ')', 0, ind_maxparen)) | 6473 if ((trypos = findmatchlimit(NULL, ')', 0, ind_maxparen)) |
6474 != NULL | 6474 != NULL |
6475 && trypos->lnum == our_paren_pos.lnum | 6475 && trypos->lnum == our_paren_pos.lnum |
6476 && trypos->col < our_paren_pos.col) | 6476 && trypos->col < our_paren_pos.col) |