Mercurial > vim
comparison src/edit.c @ 419:f713fc55bf7b v7.0109
updated for version 7.0109
author | vimboss |
---|---|
date | Mon, 18 Jul 2005 21:58:11 +0000 |
parents | 06234af3a8b7 |
children | 8b77f61b399b |
comparison
equal
deleted
inserted
replaced
418:84825cc6f049 | 419:f713fc55bf7b |
---|---|
1968 | 1968 |
1969 if (p_ic && curbuf->b_p_inf && len < IOSIZE) | 1969 if (p_ic && curbuf->b_p_inf && len < IOSIZE) |
1970 { | 1970 { |
1971 /* Infer case of completed part -- webb */ | 1971 /* Infer case of completed part -- webb */ |
1972 /* Use IObuff, str would change text in buffer! */ | 1972 /* Use IObuff, str would change text in buffer! */ |
1973 STRNCPY(IObuff, str, len); | 1973 vim_strncpy(IObuff, str, len); |
1974 IObuff[len] = NUL; | |
1975 | 1974 |
1976 /* Rule 1: Were any chars converted to lower? */ | 1975 /* Rule 1: Were any chars converted to lower? */ |
1977 for (idx = 0; idx < completion_length; ++idx) | 1976 for (idx = 0; idx < completion_length; ++idx) |
1978 { | 1977 { |
1979 if (islower(original_text[idx])) | 1978 if (islower(original_text[idx])) |
2008 was_letter = isalpha(original_text[idx]); | 2007 was_letter = isalpha(original_text[idx]); |
2009 } | 2008 } |
2010 } | 2009 } |
2011 | 2010 |
2012 /* Copy the original case of the part we typed */ | 2011 /* Copy the original case of the part we typed */ |
2013 STRNCPY(IObuff, original_text, completion_length); | 2012 vim_strncpy(IObuff, original_text, completion_length); |
2014 | 2013 |
2015 return ins_compl_add(IObuff, len, fname, dir, reuse); | 2014 return ins_compl_add(IObuff, len, fname, dir, reuse); |
2016 } | 2015 } |
2017 return ins_compl_add(str, len, fname, dir, reuse); | 2016 return ins_compl_add(str, len, fname, dir, reuse); |
2018 } | 2017 } |
3051 tmp_ptr = find_word_start(tmp_ptr); | 3050 tmp_ptr = find_word_start(tmp_ptr); |
3052 /* Find end of next word. */ | 3051 /* Find end of next word. */ |
3053 tmp_ptr = find_word_end(tmp_ptr); | 3052 tmp_ptr = find_word_end(tmp_ptr); |
3054 if (tmp_ptr > ptr) | 3053 if (tmp_ptr > ptr) |
3055 { | 3054 { |
3056 if (*ptr != ')' && IObuff[len-1] != TAB) | 3055 if (*ptr != ')' && IObuff[len - 1] != TAB) |
3057 { | 3056 { |
3058 if (IObuff[len-1] != ' ') | 3057 if (IObuff[len - 1] != ' ') |
3059 IObuff[len++] = ' '; | 3058 IObuff[len++] = ' '; |
3060 /* IObuf =~ "\k.* ", thus len >= 2 */ | 3059 /* IObuf =~ "\k.* ", thus len >= 2 */ |
3061 if (p_js | 3060 if (p_js |
3062 && (IObuff[len-2] == '.' | 3061 && (IObuff[len - 2] == '.' |
3063 || (vim_strchr(p_cpo, CPO_JOINSP) | 3062 || (vim_strchr(p_cpo, CPO_JOINSP) |
3064 == NULL | 3063 == NULL |
3065 && (IObuff[len-2] == '?' | 3064 && (IObuff[len - 2] == '?' |
3066 || IObuff[len-2] == '!')))) | 3065 || IObuff[len - 2] == '!')))) |
3067 IObuff[len++] = ' '; | 3066 IObuff[len++] = ' '; |
3068 } | 3067 } |
3069 /* copy as much as posible of the new word */ | 3068 /* copy as much as posible of the new word */ |
3070 if (tmp_ptr - ptr >= IOSIZE - len) | 3069 if (tmp_ptr - ptr >= IOSIZE - len) |
3071 tmp_ptr = ptr + IOSIZE - len - 1; | 3070 tmp_ptr = ptr + IOSIZE - len - 1; |
3739 if (completion_matches > 0) | 3738 if (completion_matches > 0) |
3740 sprintf((char *)IObuff, _("match %d of %d"), | 3739 sprintf((char *)IObuff, _("match %d of %d"), |
3741 curr_match->number, completion_matches); | 3740 curr_match->number, completion_matches); |
3742 else | 3741 else |
3743 sprintf((char *)IObuff, _("match %d"), curr_match->number); | 3742 sprintf((char *)IObuff, _("match %d"), curr_match->number); |
3744 STRNCPY(match_ref, IObuff, 30 ); | 3743 vim_strncpy(match_ref, IObuff, 30); |
3745 match_ref[30] = '\0'; | |
3746 edit_submode_extra = match_ref; | 3744 edit_submode_extra = match_ref; |
3747 edit_submode_highl = HLF_R; | 3745 edit_submode_highl = HLF_R; |
3748 if (dollar_vcol) | 3746 if (dollar_vcol) |
3749 curs_columns(FALSE); | 3747 curs_columns(FALSE); |
3750 } | 3748 } |