comparison src/ex_getln.c @ 1329:417c4d78a09c v7.1.043

updated for version 7.1-043
author vimboss
date Sat, 28 Jul 2007 12:21:47 +0000
parents 4ce0a7e4c6b3
children 2ae2dd2591fa
comparison
equal deleted inserted replaced
1328:4c70a10ce2bb 1329:417c4d78a09c
2093 int indent; /* indent for inside conditionals */ 2093 int indent; /* indent for inside conditionals */
2094 { 2094 {
2095 garray_T line_ga; 2095 garray_T line_ga;
2096 char_u *pend; 2096 char_u *pend;
2097 int startcol = 0; 2097 int startcol = 0;
2098 int c1; 2098 int c1 = 0;
2099 int escaped = FALSE; /* CTRL-V typed */ 2099 int escaped = FALSE; /* CTRL-V typed */
2100 int vcol = 0; 2100 int vcol = 0;
2101 char_u *p; 2101 char_u *p;
2102 int prev_char = 0; 2102 int prev_char;
2103 2103
2104 /* Switch cursor on now. This avoids that it happens after the "\n", which 2104 /* Switch cursor on now. This avoids that it happens after the "\n", which
2105 * confuses the system function that computes tabstops. */ 2105 * confuses the system function that computes tabstops. */
2106 cursor_on(); 2106 cursor_on();
2107 2107
2150 break; 2150 break;
2151 pend = (char_u *)line_ga.ga_data + line_ga.ga_len; 2151 pend = (char_u *)line_ga.ga_data + line_ga.ga_len;
2152 2152
2153 /* Get one character at a time. Don't use inchar(), it can't handle 2153 /* Get one character at a time. Don't use inchar(), it can't handle
2154 * special characters. */ 2154 * special characters. */
2155 prev_char = c1;
2155 c1 = vgetc(); 2156 c1 = vgetc();
2156 2157
2157 /* 2158 /*
2158 * Handle line editing. 2159 * Handle line editing.
2159 * Previously this was left to the system, putting the terminal in 2160 * Previously this was left to the system, putting the terminal in
2207 ++line_ga.ga_len; 2208 ++line_ga.ga_len;
2208 } 2209 }
2209 redraw: 2210 redraw:
2210 /* redraw the line */ 2211 /* redraw the line */
2211 msg_col = startcol; 2212 msg_col = startcol;
2212 windgoto(msg_row, msg_col);
2213 vcol = 0; 2213 vcol = 0;
2214 for (p = (char_u *)line_ga.ga_data; 2214 for (p = (char_u *)line_ga.ga_data;
2215 p < (char_u *)line_ga.ga_data + line_ga.ga_len; ++p) 2215 p < (char_u *)line_ga.ga_data + line_ga.ga_len; ++p)
2216 { 2216 {
2217 if (*p == TAB) 2217 if (*p == TAB)
2226 msg_outtrans_len(p, 1); 2226 msg_outtrans_len(p, 1);
2227 vcol += char2cells(*p); 2227 vcol += char2cells(*p);
2228 } 2228 }
2229 } 2229 }
2230 msg_clr_eos(); 2230 msg_clr_eos();
2231 windgoto(msg_row, msg_col);
2231 continue; 2232 continue;
2232 } 2233 }
2233 2234
2234 if (c1 == Ctrl_D) 2235 if (c1 == Ctrl_D)
2235 { 2236 {
2271 } 2272 }
2272 2273
2273 if (IS_SPECIAL(c1)) 2274 if (IS_SPECIAL(c1))
2274 c1 = '?'; 2275 c1 = '?';
2275 ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1; 2276 ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
2276 prev_char = c1;
2277 if (c1 == '\n') 2277 if (c1 == '\n')
2278 msg_putchar('\n'); 2278 msg_putchar('\n');
2279 else if (c1 == TAB) 2279 else if (c1 == TAB)
2280 { 2280 {
2281 /* Don't use chartabsize(), 'ts' can be different */ 2281 /* Don't use chartabsize(), 'ts' can be different */