Mercurial > vim
comparison src/ex_getln.c @ 41:f529edb9bab3 v7.0025
updated for version 7.0025
author | vimboss |
---|---|
date | Mon, 27 Dec 2004 21:59:20 +0000 |
parents | 410fa1a31baf |
children | c75153d791d0 |
comparison
equal
deleted
inserted
replaced
40:f1d2a58883b9 | 41:f529edb9bab3 |
---|---|
1962 { | 1962 { |
1963 int i, v; | 1963 int i, v; |
1964 char_u *q; | 1964 char_u *q; |
1965 | 1965 |
1966 --line_ga.ga_len; | 1966 --line_ga.ga_len; |
1967 ++line_ga.ga_room; | |
1968 /* compute column that cursor should be in */ | 1967 /* compute column that cursor should be in */ |
1969 v = 0; | 1968 v = 0; |
1970 q = ((char_u *)line_ga.ga_data); | 1969 q = ((char_u *)line_ga.ga_data); |
1971 for (i = 0; i < line_ga.ga_len; ++i) | 1970 for (i = 0; i < line_ga.ga_len; ++i) |
1972 { | 1971 { |
1990 | 1989 |
1991 if (c1 == Ctrl_U) | 1990 if (c1 == Ctrl_U) |
1992 { | 1991 { |
1993 msg_col = startcol; | 1992 msg_col = startcol; |
1994 msg_clr_eos(); | 1993 msg_clr_eos(); |
1995 line_ga.ga_room += line_ga.ga_len; | |
1996 line_ga.ga_len = 0; | 1994 line_ga.ga_len = 0; |
1997 continue; | 1995 continue; |
1998 } | 1996 } |
1999 | 1997 |
2000 if (c1 == Ctrl_V) | 1998 if (c1 == Ctrl_V) |
2022 msg_outtrans_len( | 2020 msg_outtrans_len( |
2023 ((char_u *)line_ga.ga_data) + line_ga.ga_len, 1); | 2021 ((char_u *)line_ga.ga_data) + line_ga.ga_len, 1); |
2024 vcol += char2cells(c1); | 2022 vcol += char2cells(c1); |
2025 } | 2023 } |
2026 ++line_ga.ga_len; | 2024 ++line_ga.ga_len; |
2027 --line_ga.ga_room; | |
2028 escaped = FALSE; | 2025 escaped = FALSE; |
2029 } | 2026 } |
2030 windgoto(msg_row, msg_col); | 2027 windgoto(msg_row, msg_col); |
2031 } | 2028 } |
2032 # ifndef NO_COOKED_INPUT | 2029 # ifndef NO_COOKED_INPUT |
2034 # endif | 2031 # endif |
2035 #endif | 2032 #endif |
2036 #ifndef NO_COOKED_INPUT | 2033 #ifndef NO_COOKED_INPUT |
2037 { | 2034 { |
2038 line_ga.ga_len += len; | 2035 line_ga.ga_len += len; |
2039 line_ga.ga_room -= len; | |
2040 } | 2036 } |
2041 #endif | 2037 #endif |
2042 p = (char_u *)(line_ga.ga_data) + line_ga.ga_len; | 2038 p = (char_u *)(line_ga.ga_data) + line_ga.ga_len; |
2043 if (line_ga.ga_len && p[-1] == '\n') | 2039 if (line_ga.ga_len && p[-1] == '\n') |
2044 { | 2040 { |
4120 if (ga_grow(&ga, 1) == FAIL) | 4116 if (ga_grow(&ga, 1) == FAIL) |
4121 break; | 4117 break; |
4122 | 4118 |
4123 ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, (int)(e - s)); | 4119 ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, (int)(e - s)); |
4124 ++ga.ga_len; | 4120 ++ga.ga_len; |
4125 --ga.ga_room; | |
4126 | 4121 |
4127 *e = keep; | 4122 *e = keep; |
4128 if (*e != NUL) | 4123 if (*e != NUL) |
4129 ++e; | 4124 ++e; |
4130 } | 4125 } |
4177 break; | 4172 break; |
4178 ++s; | 4173 ++s; |
4179 ((char_u **)ga.ga_data)[ga.ga_len] = | 4174 ((char_u **)ga.ga_data)[ga.ga_len] = |
4180 vim_strnsave(s, (int)(e - s - 4)); | 4175 vim_strnsave(s, (int)(e - s - 4)); |
4181 ++ga.ga_len; | 4176 ++ga.ga_len; |
4182 --ga.ga_room; | |
4183 } | 4177 } |
4184 if (*e != NUL) | 4178 if (*e != NUL) |
4185 ++e; | 4179 ++e; |
4186 } | 4180 } |
4187 vim_free(all); | 4181 vim_free(all); |
4245 STRCPY(cur, p[i]); | 4239 STRCPY(cur, p[i]); |
4246 cur += STRLEN(p[i]); | 4240 cur += STRLEN(p[i]); |
4247 *cur++ = '\n'; | 4241 *cur++ = '\n'; |
4248 } | 4242 } |
4249 ga.ga_len += len; | 4243 ga.ga_len += len; |
4250 ga.ga_room -= len; | |
4251 } | 4244 } |
4252 FreeWild(num_p, p); | 4245 FreeWild(num_p, p); |
4253 } | 4246 } |
4254 } | 4247 } |
4255 } | 4248 } |