comparison src/ui.c @ 170:8c60f65311fa v7.0052

updated for version 7.0052
author vimboss
date Sat, 26 Feb 2005 23:04:13 +0000
parents 0e902b8f511f
children d97518d6b325
comparison
equal deleted inserted replaced
169:0e902b8f511f 170:8c60f65311fa
136 ta_off += maxlen; 136 ta_off += maxlen;
137 return maxlen; 137 return maxlen;
138 } 138 }
139 #endif 139 #endif
140 140
141 #ifdef FEAT_PROFILE
142 if (do_profiling && wtime != 0)
143 prof_inchar_enter();
144 #endif
145
141 #ifdef NO_CONSOLE_INPUT 146 #ifdef NO_CONSOLE_INPUT
142 /* Don't wait for character input when the window hasn't been opened yet. 147 /* Don't wait for character input when the window hasn't been opened yet.
143 * Do try reading, this works when redirecting stdin from a file. 148 * Do try reading, this works when redirecting stdin from a file.
144 * Must return something, otherwise we'll loop forever. If we run into 149 * Must return something, otherwise we'll loop forever. If we run into
145 * this very often we probably got stuck, exit Vim. */ 150 * this very often we probably got stuck, exit Vim. */
148 static int count = 0; 153 static int count = 0;
149 154
150 # ifndef NO_CONSOLE 155 # ifndef NO_CONSOLE
151 retval = mch_inchar(buf, maxlen, 10L, tb_change_cnt); 156 retval = mch_inchar(buf, maxlen, 10L, tb_change_cnt);
152 if (retval > 0 || typebuf_changed(tb_change_cnt)) 157 if (retval > 0 || typebuf_changed(tb_change_cnt))
153 return retval; 158 goto theend;
154 # endif 159 # endif
155 if (wtime == -1 && ++count == 1000) 160 if (wtime == -1 && ++count == 1000)
156 read_error_exit(); 161 read_error_exit();
157 buf[0] = CAR; 162 buf[0] = CAR;
158 return 1; 163 retval = 1;
164 goto theend;
159 } 165 }
160 #endif 166 #endif
161 167
162 /* When doing a blocking wait there is no need for CTRL-C to interrupt 168 /* When doing a blocking wait there is no need for CTRL-C to interrupt
163 * something, don't let it set got_int when it was mapped. */ 169 * something, don't let it set got_int when it was mapped. */
184 } 190 }
185 #endif 191 #endif
186 192
187 ctrl_c_interrupts = TRUE; 193 ctrl_c_interrupts = TRUE;
188 194
195 #ifdef NO_CONSOLE_INPUT
196 theend:
197 #endif
198 #ifdef FEAT_PROFILE
199 if (do_profiling && wtime != 0)
200 prof_inchar_exit();
201 #endif
189 return retval; 202 return retval;
190 } 203 }
191 204
192 /* 205 /*
193 * return non-zero if a character is available 206 * return non-zero if a character is available